You have to accept a whole lot of other-than-friendship muck-ups without getting angry or bitter. It is just the way of the world.
This works best when there is at least some degree of social functionality. Also, I find that it helps to stop applying the "self-improvement" template for making friends that is found in many books intended for neurotypicals.
It always occurred to me that I probably was "weird." So, no problem, just mask to cover that up. As it turns out, there is not a cloaking device that works very well for this. When I finally got old enough to admit that probably the reason 90% of people ran away fast was just that I'm weird and that I'm not going to suppress this, it became a lot easier to just play the averages as the quoted remark above appears to imply. Sometimes it's hard to not be excessively impacted by rejection, or the implication of it. Now when I write "weird," I mean what the word means but it's not a disgraceful or shameful thing. I like those things about myself. It just turns out that most other people don't.
I am 54 and now can say that I have a good friend. It actually happened gradually, but before we knew it, we found ourselves truly helping each other and feeling very comfortable with each other and came to the conclusion: ah, this is what true friendship is like then?!
...I would say she is the one true friend and had to wait to this age for that to happen.
This reminds me of the situation after I left my long-term job some years ago. I really was demoralized at how few contacts I was able to maintain from that job. These weren't just acquaintances--they also were colleagues and that connection was bigger than just working at the same employer. Or so I thought. I ended up having regular contact with only one person that I had worked with--out of dozens for more than 25 years. I tried, but it didn't work out.
That one person? It was someone that I always figured didn't really like me very much. We worked together from time to time, but I figured after I left that would be the last person I'd hear from. A year or so later, I got a call because the consulting firm he had taken a job with needed a part time person with my expertise. It became apparent that he really respected my work. I had no idea, before that point. Over time, we became better friends.
My point in mentioning this is that one has to be receptive to unexpected situations. We're always told how we can "plan" to have friends. I don't think it's that simple. There are some people who are geniuses in figuring out how social psychology works and putting that knowledge to work for them. Autistic people have a social disability with this, and so we initially fail to appreciate how complex and beyond our reach it really is.