Integration is a two way street, but the expat controls only one lane, so it pays to drive that one well. What consistently earns acceptance: real effort with the language, even imperfect; participation in shared life such as neighbourhood events, school activities, clubs, and festivals; respect for norms around noise, greetings, and social rituals; and patience, since trust in many cultures is granted slowly through repeated contact rather than charm.
The factors outside your control matter too. Some societies are structurally open to newcomers while others are warm on the surface but hard to enter deeply, and attitudes can differ between big cities and small towns. Knowing the local pattern helps you interpret slow progress correctly rather than personally.
The common failure modes are the expat bubble, comfortable but permanently outside, and forced assimilation that burns people out. The sustainable middle is showing up consistently as yourself: keep your identity, adopt local ways where it matters, and let time do work that effort alone cannot.