What really helped me was keeping my heart and mind separated, for example, I could care about him but this did not take away from the gambling he did and I was not going to enable his gambling.
Things can be amicable between you two, however, don’t let this be the gateway for him to ask favors or bailouts, these are his, and if he crosses the line wanting help, just back away. You have spent the last twenty plus years, believing and trusting him, but he kept gambling.
It is time you live your life, your ex is where he is because of his choices, his denial of the monster addiction in him and if he were to change, he has to do this by action, and not by just saying I have a problem. This can be a good start but doing nothing about it, is just really nothing. It is not a big deal and should not be rewarded.
Your son is lucky to have a mother like you, who is standing against this awful addiction. It is hard, it is probably the worst thing you will do in your life. However, in the end, your efforts will be rewarded by a healthy life, one free from stress, anxiety and sleepless nights.
Somewhere along the lines your ex will have to face his addiction, it may be years from now, but he will and maybe then he will do something about it. Any enablement by you or anyone is not going to help him and prevent a possible rock bottom. It was when I completely shut the door on the addiction did my father’s life start crumbling down to where he eventually got the help he needed. Still my life was who I was trying to save and my children’s, not so much my father’s. He had made a clear choice that he was going to continue gambling and this was enough for me to move on to a better life.