Make a decision to accept the breakup. Stop holding on to hopes of reuniting. To do this, stop calling your ex and cut ties, like going to the same gym. Take some time away.
Tell your friends not to mention your ex. When your friends bring up the situation, you'll have a more difficult time finding closure. Also, stop talking about him and asking questions about him with your mutual friends.
Write him a letter. Don't actually send him the letter since you're stopping all contact with him, but write all of the things you are upset about and wish you could change. After you write the letter, make a pact to yourself to make it the last time you think about him in depth. When he pops into your head again, remind yourself the relationship is over and try to think about something else.
Find activities and hobbies you like. Spend time pampering yourself and focusing on self improvement like exercising and living a healthy lifestyle. Do things because you want to, not because someone else wants you to do them.
Start dating again. Ask friends to set you up on blind dates, or use dating websites to dabble in the dating scene. Take it slow at first and work up to another long-term relationship.