I have a problem letting go of a past relationship. Not my present husband, but I relationship that I have always mourned. I found this article helpful:

How to Let Go of Past Loves

It is the first article I have read that actually give techniques to stop the obsessive thoughts.