Comment by ifh-hn
I'm not sure what help my "advice" is going to be so I'll start with a little context.
I'm near 50 and have basically zero friends. I have colleagues and acquaintances who I get along with. I'm also married with children. I always found it hard to make and keep friends.
I was badly bullied at school and felt worthless and didn't have the confidence at that time to make friends, though I couldn't see it, but I really wanted to, I just didn't know how. At the time I was lonely and depressed. I joined the military just before I was your age and had buddies until I left and it was the military that sorted me out.
With the benefit of age and lack of hormones I've come to accept that I have no friends for reasons. It doesn't bother me anymore. I've also realised I'm not a good friend, I make no effort, I'm not really interested in other people and find their problems annoying. I'm difficult and I don't really like people. And I like my own company.
Do I worry about loneliness? No, but I often wonder if I didn't have my family would I get lonely... I don't know. All I know is that at the moment I'm not and I don't think I will be. But change is constant.
All this is to say that you're young, it's likely not as bad as you think it is right now (I don't say this to lessen what you feel), and you will get passed this. Just be yourself, do what interests you and make the effort, even if it's not reciprocated. There's no shame in making unappreciated effort. Move on and don't over-think shit. Eventually it'll come.
I'm in a similar situation. Was bullied/abused as a youth, made to feel worthless, had trouble socializing, now older, fairly alone, and don't care as much. Lack of social skills become less of a trouble as one ages, I've found, depending on the circumstances, which is quite comforting.