If it's your first time (or even second) you can't really stop it.
The best thing to keep in mind is that it's good for you. You're growing.
You're ready to take on better women now and you know what you're doing that much more.
The pain will last for awhile and anyone who says otherwise is lying to you.
The best thing you can do is cut contact for as long as possible and avoid stalking her (looking at her FB everyday.. make it a priority to stop looking at her in any shape or form for at least 3 weeks).
This will allow yourself to heal and think about other things. And believe it or not, there are a lot of things that you're going to look forward to.
Heal.
Rebuild.
Conquer.
Believe it or not, inbetween the healing and the rebuilding there's going to be a lot of positive feeling within you if you have your mind right. Your mind is going to be telling you such things as 'Alright time to take what I've learned and make myself better' or 'Ok, now I'm new and improved and ready to build on myself more. People aren't even going to recognize me soon.'
And just remember that every man who knows what he's doing with women has gone through this if not once, multiple times. I for one could point you to some depressing posts from 2 years ago when my ex broke up with me. I was demoralized, but it's made me that much better.
Most gratifying is that every woman I've dated after, I've loved more. And then after that breakup, the next one I loved even more. So don't fool yourself into thinking you'll never find someone you love. It's almost always in your head that this belief of 'love' is built up. You won't truly realize that it's all in your head until you get it out.