Friendliness toward tourists is mostly a two-way street, and certain visitor behaviors reliably open doors everywhere. Greeting people in the local language, even badly, is the single most powerful one; it signals effort and humility in one breath. Smiling, greeting shopkeepers before asking for anything, accepting hospitality graciously, complimenting the food, and showing real curiosity about how things work all mark you as a guest rather than a consumer.
From the local side, you can read welcome in small signals too: people offering directions unprompted, inviting you to sit or share tea, correcting your pronunciation with a laugh, or introducing you to family. In hospitality-strong cultures, these invitations are sincere and refusing them too quickly can disappoint.
A few habits amplify goodwill over time if you are staying longer: shop at the same local vendors so they know your face, tip or pay fairly without theatrical haggling, dress with local sensibilities in mind, and speak positively about the place when asked how you like it, because that question is often a small test of respect.