At 41 y/o I am going mostly through the same. Without my wife I would have become a completely numb robot. But even if you don't have a good partner -- or friends, or your older family -- to turn to, I'd recommend the following:
Engage in interviews but be upfront: you're not looking to prove yourself, you are not interested in stocks / futures / options / whatever, you're not scared of tough work but you're also looking for a good work-life balance, and you're willing to take a small pay cut for not taking on all the responsibilities that senior programmers are expected to have.
Say something like this: "I have all the chops to not only be a senior programmer but also a team leader; I have all the necessary qualities but I don't want to practice them for a while. I'd like to use those skills simply to be the best colleague you have."
I don't know you so the following might be severely misplaced and please forgive me if so: but I'd advise you to take A LOT of walks in nature. Even if you don't have some nearby, find a routine every now and then: take a taxi to a nearby big park (or bike/drive to it), and force yourself to just not think about anything.
Additionally, re-read a favourite book -- even if it dates back to your teenage yours.
You likely have a lot of negative inertia in your brain and you need to engage in semi-passive lifestyle to help it remove the negativity by itself which usually happens by eating well and sleeping as much as you need.
Finally, consider cannabidiol (CBD / cannabis) pills. They are absolutely harmless, they cause no hallucations at all, you can't overdose on them (I am getting those with 15% concentration), and their general effect is to slightly alter your brain chemistry in the direction of reducing anxiety. It will help you look at things from a new angle and I found it extremely therapeutic because this in turn helped me deal with my problems in sustainable and lasting ways. (Unlike before when my knee-jerk reactions only made things worse with time.)
Meditation, if you can master doing it for 30-40 minutes, works wonders too. Mind you, some people need weeks of practice every day until they feel this tranquil state of mind. Eventually everybody succeeds though.
I wish I could actually help you because I think I know what you're going through. There is a way out but sadly it never happens exactly as we want it, e.g. we can't just not work until we feel better. But there are middle grounds that help achieve the same result, albeit slower and with a bit more deliberate effort.
I hope you manage to pull through.
(EDIT: Forgot to mention something important: cardio exercises! Forget strength training. Absolutely learn basic yoga for stretching -- especially the exercises that deal with your core area because they will heal your guts and bowels! -- and do loads of cardio: run, bike, plank, nevermind which one. Find your cardio thing. Again, forget about strength training. We the sedentary people need to get our metabolism going again. Make your heart pump faster, consistently and regularly. That's the exercise that's going to make the biggest difference for your mental health.)