Obsessive compulsive disorder, or OCD, is an anxiety disorder that affects about 3% of the population in the United States. When most people hear the term "OCD" they often think of the stereotypes such as people washing their hands excessively throughout the day, being fearful of germs, having to engage in repetitive acts such as checking to make sure they locked the front door or turned off the stove, and so on.
When people have compulsions such as those mentioned above, the traditional treatment used is cognitive-behavior therapy (CBT), a treatment that combines looking at a person's thinking patterns with exposure therapy - having the patient expose herself to the feared stimulus without engaging in the compulsions she would normally use to reduce her anxiety. In other words, a therapist would have a client not wash her hands when she felt the need, and over time, the client learns to tolerate the anxiety this generates so that she can eventually stop herself from engaging in the compulsive behavior.
A less common type of OCD, however, involves more obsessional thoughts rather than compulsions. This is sometimes called "Pure O", and the people suffering from these obsessional thoughts can be quite tormented by them. I've worked with clients who have had thoughts that they are going to kill or otherwise harm their family; that they are going to act sexually inappropriately; that they have done something "wrong" or "bad" that they have no memory of, and so on. Because in this type of OCD there may not be an overt compulsion that the person is acting on, and that we can therefore do exposure therapy with, it tends to be more difficult to treat. When this is the case, then, we still use CBT as much as it applies, but we also use another technique called Mindfulness (this is a helpful technique in treating OCD in general).
In his book Brain Lock, Jeffrey Schwartz describes OCD as causing the brain to act like a car's gear shift that gets stuck - essentially, he says, the brain gets stuck in gear and can't shift out of that OCD thought. He then goes on to describe how to use mindfulness to get the brain unstuck, in order to treat both obsessive thoughts and compulsions.
Although often portrayed as a humorous illness (e.g. As Good as it Gets, Monk) it's important to realize that OCD can be debilitating and that individuals with this illness really do suffer.