Sorry you are bumming. Many of us have been through it one time or another.. hell some of us have languished in the deep end of the lonely/depressed pool for so long, that it gets difficult to keep perspective.
Anyway good on you for posting here and getting a little lively discussion going (and not just harping on "life sucks, I hate everything, people are so dumb, the world is fucked up,,") The world is the world, it's always going to be full of good and bad everything, these days especially it's difficult to tune in ANY where and not get bombarded with constant clickbait designed to keep your eyes and ears saturated with things to be upset about. If you need to be upset.. LET yourself, take some time and work it out in your head, no one should feel bad about feeling bad. And like I said above, it can be tough not to wallow after awhile, but try to engage with other things in life/seek out different things that are a little out of the ordinary for you, to get your mind working, get some stimulation, brighten up your world.
Like anything, that takes work, and there's never a switch you can flick to just make things better. Well I mean there IS -booze and drugs etc - but that's not a real solution and can eventually pile on the problems as well (to the point where you look back at "I remember when I was merely depressed!" and that will feel QUAINT...)
I remember a bunch of years ago, moving on a whim to a new city, I was in my mind 20s, totally started over - new job, new surroundings, away from all my friends and family, everything and everyone I knew, basically. It was the best and worst time of my life. Drank a lot, that compounded things, then after a couple of years I hit a rock bottom and man it was fucking loooooonely. I started throwing myself into the city.. just going out, finding cool spots, looking for my people. Went to TONS of comedy clubs, saw lots of other live performances, between that and keeping busy with work it started to give me a sense of belonging and peace, even if it was just ... hanging out in these lonely places with other lonely people. But at least it started feeling connecting, and getting comfortable with doing my thing and spending my time (and not just being shitty and destructive, or pacing endlessly or whatever). A lot has happened in my life since, but I'll always reflect on that period where I had to just get used to being where I was, and finding the beauty and coolness in it - what was special, how it started feeling like it was opening up to me and that I felt like I belonged and was a part of something, besides just sitting home by myself and feeling lost and aimless.
Sorry for the long ass rant. I guess this thread hit me in a certain mood. You can probably tell that I'm going through some stuff right now as well.. but it is gonna be ok, we learn to deal with this stuff as it is learning to deal with just the world, and other people. Overall we need each other, and obviously, we do care about each other.
Before i start feeling ludicrous for going on much longer.. OP you said you did some bad shit that upset your friendships, maybe even ruined them. Yeah that stuff happens, we all make mistakes and we all do things that we are not proud of. Some things are way, WAY worse than others of course, but at the end of the day you just gotta be the best person you can, and try to learn from your past, and move on. People can come and go, sometimes it's irrelevant and other times it hurts. And when it's some dumb, dumb, REAL dumb thing that you did, well yeah that can do a number on your head and self esteem and etc. You feel awful for hurting people that you love, for whatever reason. But it's done, and you're here now. Just try to grow past it and be a good person and do other good things in the world. Honestly karma is real, if you are out there putting positive things out into the world, regardless of the past, odds are that good things - happy things- will come back to you. Best of luck my gaf friend.