My ex broke up with me after ~2.5 years. At first I was crushed and desperate to stay in her life in any way possible, even though she had moved on to someone else.
After two very depressed weeks I began to realize she got rid of me for all the right reasons and I completely cut myself off from her (it was VERY hard to do this but ultimately I'm very happy I did). You need to convince yourself that you're better off without her, just as she is without you.
This makes little sense and sounds horribly irrational but trust me it is the truth. I feel fortunate to have discovered this in as little time as I did, it may take you longer, but you need to repeat this to yourself EVERY time you think about her or want to speak with her. Eventually the urges will lower in frequency as she becomes less a part of your routine existence.
While you're doing this, focus on making yourself a better person. Intellectually, emotionally, physically, you name it. Treat it like running. Log your progress, push yourself to do things you wouldn't normally do and then give yourself some easy days in between. Breakups are a great time to reflect on who you are, decide if you're happy with yourself (maybe you are, in which case, disregard this paragraph) and use that to motivate change.
3 months later I am the happiest I have ever been in my entire life. And this is with me not having said more than 5 words to the ex in that time, even after she repeatedly tried to contact me. If you told me this would be the case right after we broke up I would have laughed and said impossible. Now I realize there was no other way.
I got lucky and made / rediscovered some amazing friends during this period which have made things infinitely easier, perhaps there are some out there that you can talk to about life (and not about your ex).
Do I still think about her from time to time? Of course. We spent three years together and deeply cared about each other for much of that period. Do I sometimes have the urge to talk to her? Definitely, but I don't ever allow myself to act on it. I took her phone number out of my phone, her screename off my buddy list, her e-mail out of my contacts, everything. I still know them all by heart but that extra 'wait a minute' thought has helped me out on a few occasions.
Ultimately if the two of you were meant to be friends you'll find a way back into each other's lives, but wait for that point when you have no question in your mind that it will only be as a friend before you let it happen.
I don't feel as if I've reached that point yet (I honestly don't know if I ever will), but I'm happy with the way my life is going, I think she is too, and ultimately that's what matters.
Good luck!