@AnonymousMoose,
Yes, and it's not as hard as you may think. There are several ways you can do this. So, start with the basics, without getting lost in scientific boring crap. So your brain makes you sad, you don't really have any control over how crappy sadness feels. It's all really up to what kind of chemical cocktail your brain decides to mix up for you. What you can control, are memories. It's the memories of your ex that will trigger this reaction. Depending on the length of your relationship it may take a couple weeks to adjust. All of your habits with your ex, phone calls, cuddling, watching movies late at night, lunch dates you will need to fill with something else pleasurable, or to keep you busy. Your memories are only stories you tell yourself of the past. The less you tell yourself this story, the less you get this reaction.
Oh and by the way, you can't sit and try not to think about it. Spend 10 minutes trying not to think about anything. It turns out to be difficult. Just do things you have wanted, or needed to do.