I think it really depends on who decided to end the relationship and under what circumstances. If you reached the conclusion that your life would be better off without someone you most likely have given it a lot of thought and probably have devised a plan for moving on. If you are the one being "dumped' it may come as a bit of shock initially. However when you look back on things you realize that there were clues that the relationship had cracks in it. In fact you may have been playing a sort of "going along to get along" game yourself.
The first thing you have to do is accept that it's over. (In the end you are always better off not being with someone who does not want to be with you) or has half hearted feelings towards the relationship. Eventually most breakups lead to better relationships down the road and in fact you might find yourself being grateful at some point when you find your new love.
Each of us chooses our own friends, lovers, and spouse. There is no getting around that. Your next step is to (forgive yourself) for choosing the wrong mate for yourself. Hopefully you learned some lessons about yourself and what to look for in others which will help you in the future when it comes to selecting a mate. In the big scheme of things a breakup or a divorce is nothing more than one or both people reaching a conclusion that a mistake was made. It's not the end of the world!
Many times people (re-discover themselves) after a breakup. Maybe they gave up some things they enjoyed, stopped associating with certain friends, or had set their own goals/dreams aside. They use this time to get back to who they were and continue to grow. Ideally you should have friends, family, and co-workers who are there to listen to you, support you emotionally, and help you keep things in perspective.
Lastly don't get sucked into idea of trying to "get your ex back". More often than not attempts to do so lead to being a "booty call" or "friends with benefits" at best. Rarely does it work out because the people involved have not changed at their core level. Relationships end for a reason and it's usually a good reason. Once you've given your best the first time around there is nothing you can do differently the next time around. Remember your future lies ahead of you and not behind you!