Talking, excercise, medication, rest.
Talking to a friend, or even spending time with a friend without talking, can be extremely helpful when you are distressed. If friends are not available there are 24hr helplines who will talk to you in confidence, they will not ask for your name or try to trace you phone number. Counsellors, psychologists and doctors can help. If these options are not suitable or available, going for a walk or taking any form of exercise is proven help against depression.
Many people are worried about taking prescription drugs but anti-depressants and tranquillisers can help you get through a bad patch, while you work out some longer term solutions, get medical advice from a professional you trust and get along with.
When you feel really bad, or have suicidal thoughts, go to sleep!
The old phrase is true; many problems will seem much less serious in the morning. If the pain does continue, there are people and treatments that can help you, without needing to consider ending your life. You would never tell a friend to end their lives because of a distressing event in a relationship, so give yourself the same advice.