Make new connections, go further afield, join a group, meetup or something local. Going somewhere or doing something you enjoy is best because it reflects in how you are, and even if it goes badly you've still had a pretty good time. Try new shit out too, get a hobby, something you maybe want to try that also has the age group and type of people you want to meet. Exercise helps mental health and keeps you fit and you may meet people... there's running groups, hiking groups, etc. Go to the gym often enough you meet people. Each experience increases the chances of meeting people or making friends
If you're into gaming, find partners to game with online and if they're close, meet up.
Also, if you can afford it, get a dog. Get a nice dog. People often love them and that by itself strikes up conversations. They give you exercise, and follow you around like you're their hero. You won't be alone with one.
The more you do and the wider the net, the more people you meet, and hence the more friends.
Having interests and being interesting goes part of the way.
Your job.... You have a job, which is more than me right now with two degrees. You'll find that too may improve in time, maybe find out about other jobs and opportunities as you talk to people.
Consider mindfulness or CBT with mental health. They can help you stay focused on the moment, get past bad thoughts and reframe everything.
We all learn by fucking up, in different degrees. It's shit but effective at giving lessons.
You've not failed at all, and it can get better my friend.