For me:
1. Neighborhood matters a lot. This determines the kinds of events you’ll go to and people you see regularly. I explored a lot before I settled some place that felt like home. I live some place with good walkability and being able to walk to a coffee shop or park has been very important.
2. Hobbies. Outdoor fitness, DIY/underground music, and board games for me. It took some digging to find groups I liked (some of which I found out about online and some by asking people I met), but now I participate in at least one event/meetup pertaining to these hobbies every week (more if I can). Ex helping out at a DIY show, run clubs, hiking groups, board game meetups.
3. Having a dog. I’m outside regularly bumping into people. Having a dog often sparks a conversation and helped me to know my neighbors. You don’t really need a dog though any way you can open a conversation is good. Compliment someone’s shirt, ask a question, etc
So TL;DR walkable neighborhood that suits you, find something related to your hobbies and do it as much as you can, start conversations.
Good luck, it took me years before I got into a rhythm.