Obsessions are divided into two categories. The first of them is akin to the ritual. For example, you used each time,thinking about something unpleasant for you to spit over your left shoulder. And after a while you notice that you have thoughts about what if you don't comply, something bad will happen. The second category tends to focus thoughts around one specific topic.
Do not attempt to drive away unpleasant thoughts. They will certainly come back again. Reprogram your consciousness. Try to turn the situation into a positive experience. To do this, think more about the positive things that have happened in your life.
Don't upset yourself over what you think about something negative. A big difference is to think about something, perhaps immoral not to do this and to commit such an act.
Do not be afraid that at some point you can break and put negative thoughts in life. A person has its own scale of moral values. And if you often think about something bad, but really understand all the implications of such a step, then the probability of the execution of this negativity you are insignificant.
Note that it is not necessary to spend years to overcome your ritual habit. If it fills you with anxiety and a bad influence on the nervous system, it is better to spend a few hours on chat with a psychologist.
You may need to undergo cognitive behavioral therapy. It lies in the fact that the patient explain the difference between reasonable and caused by his state of fear. And then, the example of man, is authority for the patient, show how to behave in such cases a healthy person.
In the presence of depression or severe anxiety, consult a therapist who will help relieve your condition with medical treatment. To do this, use antidepressants. And in chronic forms of atypical antipsychotics.