I'm watching my roommate go thru this exact same thing. He has tried to commit suicide a few times now (before I met him) and the last time he tried it, he tried to OD before going to detox that morning, while he's been living with me and then again the other night. His pain is the same, ended a relationship, she took his son, he moved across country, got into another relationship which ended badly, but she's still bugging him, push/pull kind of thing, financial problems because of drug use, chronic pain, depression, you name it.
He talks (cries) to me often about his problems, tells me he's going to do it all the time. I'm honestly at a loss as to how to deal with him. I tell him all the time I love him, which I do, because he is a really good guy, I tell him when his son gets older, no doubt he's going to come looking for him, that he has worth, he will love someone decent and who will treat him well again, he will beat this drug thing he's got going on, and his life IS worth something, even if he doesn't see it, others around him do.
Your kids need you, I'm sure you're surrounded by loving, caring people but you just may not see it because of the pain you're in. Your ex, he's just a man, plenty more where those came from and honestly, if he's going to leave you because you relapsed, he doesn't sound very supportive to me. There is soooo much good out there, you just need to be able to see it, accept it, try and let go of your pain and love yourself. I truly believe that loving yourself is the first step