I know exactly how you feel. I've always been pretty depressive, but I have only started hurting myself physically and thinking about ctb after my last breakup. I truly felt like myself with this person, and it felt nice to nurture and care for someone else so completely. They were a really great person, I still love them, and I thought they were the one. The thing that made me suicidal is the idea that even when I'm at my best and giving someone everything I can... not only am I not enough, but I unknowingly caused them so much pain and discomfort leading up to the break up. Honestly my breakup happened in March, and I'm still surviving with just my head above the water.
The number one thing you have to remember right now is that you NEED to survive, don't even question it, you NEED to survive, keep telling yourself that. Don't say anything else. You can kill many parts of yourself without removing yourself from life altogether. You understand? Killing your physical body will not give you peace. If your brain tells you that, it is lying.
The most important thing to do right now is go through the process of mourning, and to bury the person you once were. All this pain and hurt and hopelessness you are feelings is just fertilizer for a better version of yourself. All that self-improvement shit will come into play down the road, but for now just mourn. Mourn, and cry, and get it all out, and don't be worried about a time limit. You have to process everything if you want to live, and I know you do.
ALSO DO NOT CONTACT YOUR EX. it's obvious, but it's still really hard to do when you when you're this emotionally exposed and hurt. It'll just be a form of self harm, you're worth more than that shit.