There are several ways you can approach it, one of which is to talk the situation over with trusted persons or a therapist. So at least you can hash it out a little and get all the pieces out in the open for yourself where you can make sense of what happened. And sometimes just the act of sharing it (WITH THE RIGHT PERSON, I emphasize), just venting about it and sharing it, can provide some relief.
But if the pain is sourced in a current real situation such as a breakup, then you're pretty much stuck with the reality of it, which definitely sucks. I went through something like this about a year ago where I just wanted to die, and after employing the above technique of talking it over, I was still stuck with the reality of it. So then I have to go with what Thirty Shades suggests and just sit with your pain as long as you can. Hold still with it and let it wash over you. You may think it's going to kill you but it won't. I also used a technique where I visualized an entity who could comfort me, and I visualized putting my hand in the entity's hand and just sitting silently with the entirety while it comforted me as you might comfort a child. This helped a lot, over time. I had to keep doing it. Keep experiencing the pain until it finally let go.
You can only take so much of this at a time, then you might want to distract yourself somehow. But you will get absolutely nowhere if you try to deny reality, I think.
Blessings and good luck to you. Be well.