Well i think there are two ways really. Either you find those rare people that you click with right off the bat, there's chemistry. And hanging out is effortless, you're on the same wavelength. For me, it's the feeling of being able to be myself around them, not having to put on a "social mask" so to speak. And you don't mind just doing nothing with them, cause it's great just having them around (for the most part at least). Maybe you've felt something similar? These kind of connections dont happen very often imo.
And then there's the proximity principle that says that basically the people you're spending time with are the ones you're more likely to form (strong) relationships with. In a schoolsetting, at work etc.
The closest friends that I've had are the ones that I've felt were special from the get-go though. And then distance and time apart really never matters. Those I've met randomly, they seem to pop up in the weirdest of places when I least expect it.
How to find any friends though is to be out in the world (or online of course). Pursuing hobbies and possibly sharing interest, thats a good starting point.
Sorry for the somewhat vague answer, have never really sought out friends on purpose, so I'm probably not the best to give advice..