Hi I'm a psych nurse with my own mental health issues so I've both had done similar problems and worked with hundreds of other people who have had similar problems.
a) get yourself into one of those alanon groups for family and other loved ones of addicts. They will give far better advice than I or any other internet person ever will.
b) decide on your boundaries now and communicate them clearly at a moment that he's in a good headspace (don't just pop it on him right after the wife files for instance).
c) Your personal boundaries are very personal, but I do recommend you decide on how much money you're willing to give him and how. It could be anything from 1k towards the debt if you're exceptionally kind and have it to give him, to just offering to buy him a good meal now and then. If you ever help with rent or anything however, I highly recommend you pay the person he owes directly so he doesn't have a chance to think he can solve all these problems with one more because it'll finally be his big win.
c) Also decide how much you're willing to get yelled at because I can almost guarantee he's going to get frustrated with those boundaries and cuss you out at some point. You don't have to lay this out in detail but I do recommend you at least say "I do expect to not be abused." And he's not going to be joking he's going to bring up any traumas or mommy issues or whatever skeleton in your closet that he knows about. I know because I've done it and watched hundreds of other addicts do it. It's a normal response to both the internal chemical changes as his neurotransmitters re-level AND all his interpersonal relationships shift to healthier ones. You're still not obligated to sit through that. So decide how much you're willing to take now. If your line is physical aggression, decide if you're willing to put up with him getting in your face without swinging, because a lot of people who have gotten good at being addicts know how to toe lines real good so you better paint them bitches crisp.
d) recommend whatever mental health resources you can talk him into going to. Anything from support groups (AA has a lot of spinoffs for other addictions, but 12 step is usually better for more spiritual people. If he's particularly secular, try SMART instead). Also definitely encourage him to go to a psychiatrist. Even behavioral/nonchemical addictions can significantly alter brain chemistry in a way he may need a leg up to really overcome (behavioral addictions are things like gambling, binge eating, video games, and porn vs chemical ones like heroin, meth, etc. As an aside, weed is kind of a grey area, it's not super chemically addictive, but it can definitely be behaviorally so for the wrong person).
e) if you're really down for it, learn a few formal crisis intervention strategies. You could try taking a mental health first aid class or reading a book but to give you a leg up I'll tell you the skill that took me 10 minutes to learn and I literally use it every single night I work: S.E.T. communication or Support, Empathy, Truth.
Support - a simple statement that aligns your values and desires with his.
-
"I really want you to get this debt handled. I want you to get out of this and stay out of this.
-
"I want to stand by you and keep helping you with this."
Empathy - a simple statement about your understanding of why this has been difficult for them.
-
"and man it's a shitload of of money you're probably looking at like mount fucking everest."
-
"and I know you're going through it right now"
Truth - a possibly less simple statement of the best way they can step with you towards that goal. The other two steps are to give you the best possible setup and help him feel heard to get him in just the right headspace to really hear this part.
-
"I can't buy you out of this and honestly I don't think it would help you in the long run if I did. The best way to get this paid off is to not get into more shit and take what you have now one step at a time."
-
"and I wanna be here for you to lean on through this but I can't carry you. To keep working with you on this I need you working with me. I'm gonna give us both a day or two to let the steam blow off, and then I'm gonna come back and try to talk this out again so we can get back on the same page."
It doesn't work 100% of the time but compared to fumbling your way through these conversations it's practically magic.
This brings us to f) if he does get hot, DO. NOT. ARGUE. do not argue when people are not capable of responding rationally. It tends to just increase the irrationality and nuke any working relationship that's been built. He might do great for the most part but every once in a while the dopamine or adrenaline or whatever else is gonna hit just right and he'll turn into a straight asshole for a short period. Just tell him you're both gonna take a breather (phrasing it as a "mutual" breather may help him take it less personal, but if he asks, tell him you needed time to process how he treated you, don't let him make it about what you said unless you did actually say some dumb shit) and don't talk to him for AT LEAST 15 minutes. I say at least because depending on how wild he gets you might need to extend that to like 3 days or so, maybe even more. 15 minutes is just the average time it takes adrenaline to dissipate and I use that timing a lot to reapproach people at work.
Hope all this helps!