I have employed some techniques to this situation. They were read about on this site and some were even given to me by my therapist. Visualizing a stop sign whenever I am thinking about him. Telling myself it's not my fault, which works the best for me. That sort of thing
K2TOG, your screen name is reminding me that knitting is another good thing to do when I am obsessing. It occupies my mind and hands enough that I don't think about him. My mind is to preoccupied with the stitches.