The settings where genuine connection happens share one feature: you are there as a participant, not a customer. Homestays and farm stays top the list, since sharing meals and routines with a host family teaches you more in three days than three weeks of hotels. Community-based tourism, where villages host visitors on their own terms, is the organised version and exists in many countries.
Language exchanges are the easiest urban entry point: locals come specifically to meet foreigners, so the awkwardness is pre-solved. Add shared activities, a cooking course, a dance class, a hiking club, a volunteering day, where you meet people through doing rather than talking. Religious and cultural community events are often surprisingly welcoming to respectful visitors who ask first.
Everyday habits matter too: shop at the same market stalls repeatedly, eat at small family places, learn greetings in the local language, and accept invitations when they come. Curiosity plus a little language effort plus showing up regularly is the whole formula.