Obsessive Compulsive Disorder, or OCD, is characterized by experiencing either obsessions, compulsions, or both. For a diagnosis to be made, these symptoms must cause significant distress or interference in your life.
Obsessions are unwanted thoughts, impulses, or images that interrupt your thinking despite efforts to resist them.
Common examples of obsessions are thoughts about germs or contamination, recurring doubts related to anticipated dangers, or extreme concern with exactness or arranging things in a certain order.
Compulsions are (often repetitive) behaviors that you feel compelled to do to lessen anxiety, disgust, or other discomfort. The behaviors may be excessive but logically related to an obsession (like cleaning to alleviate worry about being dirty), or they may also be more random things that for some reason give you a sense of relief (like counting, repeating, or arranging).
Common examples of compulsions are washing, checking things are off or locked, rearranging, or repeating. A compulsion can also be something you do in your head, like counting, or bringing to mind a certain image.
The treatment for OCD with the most evidence of working is called Exposure and Response Prevention, or ERP. ERP helps people decrease the frequency of obsessions and compulsions, and also feel less disturbed by symptoms they are experiencing.