You have to become someone worthy of friendship... if you are a loser, you need to fix that first; fortunately there will be other losers trying to become less of a loser, so you can bond over that.
In 2023, I started working out 5x a week at outdoor gyms as I had contempt for how weak I had become as an adult, over time I became more comfortable talking to local strangers, and for some things you will be wiser and for some things they will be wiser; over jan-feb there will be an influx of new people, and it's now a good place to help them along the journey you started a year ago. Any self improvement activity will be suitable for this, eg. bouldering, running, etc; however outdoor gyms and running are good as they are free. If running, just run next to them, wave, and ask if they want a pacer for a while. (The same also applies for eating out, there is no harm in asking if you can share a table with someone to enjoy your meal together).
Eventually you'll find people you click with, and you just suggest some activities to do outside the normal workout; like sharing cultural meals, or some other hobby you may both be interested in.
If either are a tourist, suggest some sight seeing.
I haven't had any luck with meetups, or churches; meetup people have been too quirky for me, and churches have been too straight-and-narrow for me. In general, you will jive with people who have had similar experiences to you. Perhaps meetups or churches will work for you, they are certainly worth a shot.
A most important discovery I had that helped me socialise was recognising that anyone can get stuck in bad patterns and sometimes a little external influence can really help, not excluding myself. This has helped me notice and strike up conversations with people who turn out to be suffering in one way or another, who otherwise are perfectly fine, and after some external recalibration, they are back to being fine. It's the songs: Bright Eyes - Bowl of Oranges, The Streets - Edge of a Cliff. The inverse is also true, sometimes, it turns out they are the wiser and have insights for me.
Another important discovery was that many people haven't yet had friendships where the friend cares for them as a person. If you care about someone as they are, and then by extension care about what they are telling you, this can be transformative for them as sadly many people don't have or have never had anyone that actually cares about them as a person first, and persona second. If you can nail this, people open up.
A caveat here is, people are forgiving and assistive for awkwardness, but not for being creepy. A book on manners and etiquette (common before the 1980s) will help you learn the difference. If you are bad at noticing if someone has been made uncomfortable, then be like a teenager in a modern american movie and ask.
Finally, friendships like any relationship are a commitment, the better you are at them the more that accurate boundaries can be mutually intuited; from trivial light friendships you have, to strong long-term comrades in life; if you are new to friendships, or new to a particular one, this intuition takes time to learn and you may rush things or the opposite, fail to be there for a friend in a way they needed. If you are now developing a good friendship, it's worth coaching your friend occasionally on how you can both be better friends to each other; as when tragedies occur, such as a parent, spouse, or child dying, you need to be able to support them effectively and meaningfully; or if your friend and you disagree on something axiomatic, you can still heal and value the friendship regardless, without the temptation to burn a bridge.
Finally, use technology to help you. Write down everything you remember as a note in the contact for the friend. It's tiring to keep asking their names of family, what their interests are, or what the progress is on whatever it was; just write it down and review the note before catching up. And if you think of great questions to ask them, add it to the note, and bring it up next time you catch up.
If you are asking about heterosexual romantic friendships, then all the above applies and you court (additionally filter) on compatibility of these pillars: foundations, values, lifestyle, chemistry, attraction. If you are clear on those, and have implemented consistent anti-loser practices, there is no reason you won't be getting 100 likes a week, 25 matches a week, 5 calls a week, and about 5 potentialities a month. Court first, then date; no one likes their time and youth wasted. The longer you spend in courting mode, the more quality mates you'll be available and exposed to; if you jump into dating, you'll emotionally and timewise block yourself off to other potentially better options; women will want to do this to secure you and block you off subversively, so be careful and firm despite hedonism. There is no harm staying in courting and working on yourself, as a man you have all the time in the world to select someone worthwhile enough to devote to.