The difference between OCD and a Psychotic disorder is the person is not actually hearing voices.
The way I think of it is like this:
Have you ever been driving somwhere and started day dreaming, and soon after noticed that you have arrived at your destination without consciously thinking about driving? This is your sub conscious mind at work. If your subconscious mind it complex enough to navigate traffic then it is complex enough to spit up unwanted thoughts into your conscious mind. These thoughts may take the form of voices or phrases. The distinction between hallucinations and intrusive thoughts is that you hear intrusive thoughts in your minds ear. With hallucinations you actually hear these things.
The intrusive voices in your mind’s ear are actually caused by intense desire by your conscious mind to not think about these thoughts. Because you desire you avoid these thoughts with all the fiber in your being, you create a thought avoidance paradox.
Therefore the more you try to avoid these thoughts, and the more you try to suppress them, they will occur increasingly vivid and more frequent. The human brain it quite malleable, it can rewire it’s self. This has many positive and negative consequences. Unfortunately for the OCD sufferer, who usually has damaged receptors for the neurotransmitter Serotonin, they tend to freak out about these thoughts. They may think these thoughts make them a bad person, an unfit parent, or may put them in mortal sin. They try to suppress these thoughts more and more fervently. Because of this the thoughts get more vivid and more frequent. It starts a vicious circle, that eventually causes the person to develop a clinical disorder.
The best way the combat this effect is to recognize when your brain is malfunctioning. Use your reason to deduce when this is happening. Once you recognize the error, just think to your self “Ok, this is just a glitch. Don’t worry about it.” Then ignore the thought.( The thoughts will not make logical sense.
For example: “I just checked the back door. I am 100% certain I checked it. My brain is telling me that I am imagining it, or I didn’t check it thoroughly. It is telling me that if I don’t check it again I am going to be robbed. This doesn’t make sense because I know I checked it. However I want to check it again.”
Trust your reasoning. You know it doesn’t make sense. Just think to yourself “It is a glitch, don’t worry about it.” Even if it tries to make you think that if you don’t check on it, you will be worried about it the whole time you are out. (The disorder LOVES to do that

)
If you don’t trust your reasoning and check the door again. It will be even harder to resist the next time. Eventually you will be checking to door twice, then three times, then four times. Eventually you will not be able to leave the house because you can’t stop checking the door. You MUST resist it.
The good news is the same effect that causes your OCD to get worse, can also improve your condition. The more you resist, the easier it will be to resist next time. It will eventually get to a state where you still get those intrusive thoughts, but you will have complete mastery over your condition.