My psychiatrist always used to mention, (and sometimes still does), the term "automatic response" in describing an obsessive compulsive disorder (OCD), episode. In other words, your first response to an obsessive thought is to take action in a compulsive manner. She instructed me to delay the action, and to keep on delaying it over a period of time. The object was to reach the point where I did not perform the action. My treatment is about reaching that point.
What does this delaying actually entail, to be specific? Well for one thing, you can sit around on the couch saying to yourself, "I will not examine that freckle" over and over again, as well as provide yourself with all sorts of reasons for not doing so. For me that approach does not work very well. I have discovered that what works (it's not foolproof) is to totally immerse myself in an activity, whether it be physical or mental. I keep up the activity for a while. Gradually, I have discovered that the compulsion will diminish, and will eventually go away. There will be setbacks, but the longer you can wait to carry out the compulsion the better, and of course the goal is to not carry it out at all.
Socializing is also therapeutic, because it is not only a huge distraction, but it keeps you grounded. There are other things out in the world other than you and your disorder. Of course you realize this on an intellectual level, but you actually have to do it to for it to hit home.
I've discovered that the key in trying to overcome my OCD is first to shut out those obsessive thoughts. Thinking about shutting out those thoughts doesn't work very well. The physical act of total immersion in another activity is the key to cooling down that rampant brain activity. I told this to my shrink and she agreed. You can't fight those crazy thoughts with by thinking about stopping them. It doesn't work. This has been my experience anyway.