Like others I suggest you get good financial advice, psychological & or medical help (low level drugs for a while can help people make better use of psych help), a review of what you each/both want from your lives. If you know where you are, have a few dreams of where you want to be you'll find it easier to plan a way forward. Act as if your dreams can be true & you may find the reality on the way there. Get some help to stabilise his situation now so he is able to think ahead rationally but then get out before he's so bad that moving forward becomes difficult. It's harder to get another job if out of work completely so take a lower paid/ lower stress job as an interim while he sorts his life out. If he moves to another 'big' job too soon he may just collapse again. Assess your real, basic needs, whether you can add more to the loss of income if really needed & go for it. When I was in a bad way I set myself 3 questions I really wanted to answer which gave me a goal & a reason to go out & ask questions of people. In the end I based my new career on one of them & the contacts I made researching it. If he has to leave the job encourage him to stay engaged with the world even if it's going for a short walk each day &, if fit enough, by e.g. offering his services for a fee on a local level or in voluntary work (most charities need people with IT skills though he may want a complete change). When my husband wasn't good & made redundant he managed to earn as much as when in a job just by (legally) moving what money we had around to make it work hard for us until he found a different role - may appeal to an IT person.
I don't believe I've ever come across a person like him who several years later wasn't pleased they'd made a change, even if not easy on the way. Plenty who are sad they didn't though.