In my short 25 years of life I have been through my fair share of breakups; some initiated by me, some expected, some completely out of the blue. But what I have learnt, over time, is that following the below steps are key to allowing yourself to move on and not wallowing or clinging to your past.
Grieve - set yourself a time limit and use that time to properly grieve the relationship. Cry as much as you need, rely on your friends/family and reflect on the relationship. It might sound strange to suggest doing this, but if it doesn't happen at the very beginning, it will only end up happening at a later stage of the moving on process.
Reflect - even if someone has broken up with you and you were madly in love and didn't see it coming, try to take a step back and reflect on what wasn't working in the relationship. Perhaps at the time you could only look at the relationship through rose tinted glasses, but now that you have had to take them off, is there anything glaringly obvious that just wasn't quite right?
Vent - on paper, to friends, in a diary (or a blog?), everything that you feel was left unsaid, any hate (or love) that you want to hurl at them, write it all down. It's so cathartic. You will honestly feel like a weight is off your shoulders once you do.
Space - depending on how the relationship ends, try to create space between you and your ex. Whether that means not speaking, not hanging out with the same friends - just make sure you do something to give both of you time to move on to avoid the doomed scenario of falling back into each others beds/lives.
Digital Detox - in this day and age, you can break up with someone but still know their every move by obsessively stalking them on Facebook/Instagram/Snapchat/Twitter. My advice to you would be to STOP. Whether that means deleting them/hiding their profile/removing them as a friend, just do SOMETHING to remove the temptation to check what they are doing without you. It will never end well and you will drive yourself insane scrutinising their every move. I can't stress enough how freeing it feels to cut someone out of your life.
Remove their number - this ties into digital detox but I feel like it merits its own point. Delete their phone number NOW. Write it down in a safe place or give it a friend to look after, but whatever you do, don't keep it on your phone. It will create too temptation when you are down/lonely/drunk to reach out to them, not realising that this will set you back 10 steps.
Focus on YOU - whether you have been in a relationship for a month, a year or ten years, that time has involved being consumed by someone else, now it's time to focus on YOU. What makes you happy? What drives you? What can you do to be the best possible version of you? Not only will this give you something amazing (aka you) to spend your time on, but it will also detract the time and energy you spend thinking and worrying about your ex.
Do NOT blame yourself - unless you cheated. It takes two to make a relationship work and I genuinely believe that everything happens for a reason. You have absolutely no idea who or what is around the corner, but over time you will realise that everything is an experience and that your happiness doesn't end here.
LEARN - after enough time has passed and you can look at the relationship somewhat objectively, you may be able to see where things went wrong, what worked, what didn't. How you have changed or grown as a person and most importantly, what you are and aren't willing to put up with in your next relationship.