I stop thinking about an ex by becoming very busy. I spend extra time at work catching up on projects. I work out more often at the gym. I get together with friends that I haven't seen recently, and spend extra time with the friends that I have seen recently. I call old friends and family and get back in touch. Watch comedies on dvd. Go to the library and check out some books. Spend more time playing with my cat. Surf the net. Do some retail therapy at the mall. Eventually, I start going out and dating again.
Good decisions come from experience. Experience comes from bad decisions.