If you have obsessive compulsive disorder (OCD), then you can tell if you have it by examining your thoughts and your behaviors. OCD starts with intrusive, repetitive thoughts that constantly disturbs you, also known as obsessions. Common obsessions in OCD include germ contamination fears, fears of things being unlocked, fears of things being out of place, just to name a few.
In addition to obessions, if you have OCD, then you have repetitive behaviors or rituals which are done to decrease the anxiety associated with the obsessions. These repetitive behaviors are called compulsions. Common compulsions include hand washing, checking behaviors, counting rituals, rearranging rituals, etc.
An important thing to note about OCD is that the obsessions are intrusive and unwanted, and the compensatory compulsions take up so much time, that it disrupts other important parts of the afflicted person's life. So the compulsions are accurately named- the person is compelled to act to decrease the uncomfortable anxiety induced by the obsessions.
The person feels that the obsessions are intrusive, and the compulsions are done almost involuntarily. However, in OCD, the afflicted person knows that the obsessions and compulsions are excessive and crazy, so they know what is real and not real. In this way, OCD is very different from psychosis.