I've been in what I think is a similar place before. Every now and then, I still find myself right there on the edge. In those moments, for me, it's not that I want to exist, or not exist, it's just ...grey. And, an average grey at that - let's call it #CCC. Nothing drives me or energizes me. I just ... am. The advice you mention -- finding friends, connecting with the world around you, finding purpose, finding passion, finding things that satisfy the brain -- was always useless advice to me. It's honestly good advice if a person is in a position to receive it and when they try it, it actually works and moves the needle. It just didn't work for me because it was the wrong timing. I needed to solve my first problems first.

I had to figure out my brain chemistry and what my brain needed. Once everything was mostly fine-tuned through some meds and therapy, I was able to better figure out what I needed.

I found the advice that was previously useless to me made a difference. It's not like code though where you knock something out and after twenty hours of hard work you feel like you achieved something grand and you're proud of your work. No, this is a much slower pace and it requires persistence. Small attempts day by day leads to things looking entirely different after a year.

I needed to work on my physical health and exercise more. I needed healthier habits and boundaries with work. That put my brain chemistry in an even better position.

I needed a connection to people. I too am not the best at maintaining relationships. My brain has issues with object permanence. If it is not in front of me, even people, I just don't think about them. I set up a notebook as a personal CRM and I try to check in with a group of friends and a very close friend as often as I can. Be sure to make a close friend or two. Someone you can share who you really are with. Talk about the things that are not going well in your life. Our culture doesn't promote people being vulnerable with one another but it makes a huge difference if you can find a friend you feel comfortable getting close to. It was challenging for me in my mid to late thirties to try and connect with people again. People are married, have kids, and have moved on and I simply did not stay in touch. Here I was suddenly 'showing back up' as if I hadn't flaked on them for the last 15 years. It has made a difference to have friends. At the end of the day, we're a social species, even the most introverted of us. It may not feel natural or it may not even feel like it's improving your situation but keep grinding it out to create some close friends. I'm a software developer too. I find I like the ritual of being tenacious and pushing through to solve interesting problems. It's a dopamine hit for me to have an interesting problem and solve it. I then love factoring the solution until it is the best abstraction I can come up with. But, my brain has an issue with classifying "interesting" correctly so I have to hack my motivation on mundane work frequently. If an issue isn't interesting, my brain loses motivation. If it is something that really interests my brain, I'm fully on board until I understand the inner workings. I find I have to hack my motivations with relationships, too. I started to treat it as a social experiment and something I needed to figure out.

You might try to find some gregarious folks who do things outside of your comfort zone. Find people with passions that are different than yours but not in a mediocre way where you will be bored and not interested when they talk. You write code and debug it and build up a mental model of how it works. You're going to want to find people with similarly challenging work and passions. It could be anything, maybe they like riding horses, magnet fishing, riding ATVs, camping, shooting, goofing around on a podcast, rock climbing, ballroom dancing, sewing, or painting. Maybe they're just funny and make you laugh and you appreciate the hours of hard work and their ability to craft and weave an interesting story and nail it with a punch line. Find a friend that will call you up on a Saturday and get you to do something you haven't done before. Some of my best memories with friends are of them pushing me out of my comfort zones and me pushing them out of theirs. If that is too far of a reach, I've found working on open-source software gets you into a community and it's not that far of a stretch to make friends in those communities. I met a lot of people through the Asterisk PBX community decades ago. I couldn't value any of this though until I solved my first problems first.

I don't know if any of my advice is helpful or resonates. I am absolutely not an expert. I'm just another person slinging code, trying to find my wallet or keys in my house, living on this rock that is hurling through space at 1.3 million miles per hour.

My personal email is in my profile. Don't hesitate to reach out to me either.