Many of these comments recommend church. While valid if it works for you, it doesn't mesh with me.
I found community through a shared enjoyment of an activity that must be done as a group. Grass roots motorsports in my case, but any activity that needs you to be there with others should work the same. The key is that you should enjoy it and you should have time to interact with people. I like to make car go vroom, but generalize the approach and it should work.
My first season, I won an event with a hero run that sent me from 5th to 1st. When I parked, a random guy stuck his head in my window and started hyping me up for it. I still think about that 3 years later and it still makes me feel good. That feeling made me want to do that for others.
I started approaching random people I'd seen before and just starting a conversation. It was rough the first few times but it gets easier. You already have a shared activity so just start with that. I made a point to remember people's names or at least their car (bad with names, but cars stick for some reason). If the name didn't stick, I'll ask again next time and maybe bring up their car so they know I remember them. When I know their name, I use it when I see them again. Maybe just "Hey bob!" as I'm passing, but something to let them know someone there knows them and cares enough to say hi. They're not a stranger at least. If I haven't seen them in a while, I ask how they've been and spend a bit more effort on the conversation than just a "hey".
It started with the regulars. Now I'm looking for the new faces. I know stuff and they need to know that stuff, so it's easy to talk. If they come back, they should be able to find someone to talk to so I introduce them to some of the other regulars.
I look for people eating lunch alone and I go talk to them. Maybe 2 to 5 minutes, maybe longer. Depends on them. Sometimes I'm awkward. Sometimes I say dumb stuff. Whatever. I'm trying to help these people not be alone at a social event if they don't want to be. If they do, that's fine too, but I'll try again next time.
Some people are closed off and don't really want to talk. That's fine. I still say hi by name and see how it goes. Not trying to push, just keeping the door open. After a few times of trying, a lot of people will start to open up our let the guard down. Some don't.
I'm an introvert and all of this takes extra mental energy on top of the events being competition and work. I don't have the time to compete at the highest level every event because I'm spending time helping others. Rather than getting a better driver in my car to tell me where I'm making mistakes, I'm trying to get the less skilled drivers in my car so they can see why I'm faster. Instead of reviewing data over lunch to see where I'm losing time, I'm trying to build community. I want people to come back. There's a cost to it.
I moved to the middle of nowhere 10 years ago and had no local friends. Work friends are rarely real friends. Tech meets, young professionals groups, nothing came out of those. It sucks to go to a bar alone. None of that produced anything.
Motorsport has been the only activity I've tried where I've started making friends who I talk to outside the events. A lot of it is still about motorsports, but I've gained a few friends who I sim race with or talk to online in the off season. It could have been any other group or activity, but those are the people who made me feel welcome.
Real figures, there are at least 25 people I can walk up to and start a conversation with at an event and have good rapport, more that I know by name and just haven't clicked with, 2-3 people I consider actual friends. I started putting in the effort like this after my first season, so this is the product of 2 seasons of effort (winter doesn't count because there are no events). I'm still kind of lonely, but it's better and getting better.
I think it's that I put in effort. I know I've helped some of those people feel like part of a community. I gave them a few people they could talk to so they didn't feel so alone. Maybe my role was just keeping them coming back until they found their clique. Maybe I need more time to get to know them. Some introverts need an extrovert to help them get started. Sometimes that extrovert is an introvert tryhard.
The reason I do this is cause one guy stuck his head in my window after a run and said something like "bro that was awesome! Nice run!" And he was genuinely happy for me even though he barely knew me. I'm not good at that specific thing so I try in my own way.
I think people look for community. I did. I bounced off a few groups because I didn't fit in. I'm trying to do my part to help people "fit in". Tech solutions ain't gonna help here. Get face to face, make outsiders feel accepted, and see what happens.
And thanks, Clarke.