Hello & Welcome to Just Answers.
One of my teachers used to drill into our brains that the biggest sex organ is the one between our ears, and I think you've found this out. You can't eliminate a thought, but you can move it past yourself very quickly with practice using this technique:
Intrusive Thought Elimination
When you have an intrusive, unwanted thought, understand that you can't control what pops into your head, but you can control what your mind does with it once it's there. This is a big key to success. Understanding that, you choose a positive thought - one that brings up a good feeling in you. Picture it in your mind and sit with it for a minute to enhance the positive feeling, and give this picture/feeling an affirmation that goes with it. IE: picture a warm walk on a sunny day and say to yourself, "I'm on the path to recovery and I know I'm going to make it."
Every single time one of the unwanted thoughts pops up in your mind, exchange it for your chosen thought. Do this every single time no matter if you have to do it 100 times an hour. Do it without fail. What you'll accomplish is to re-train your brain and you'll see that your intrusive thoughts will trigger your chosen thought, which will give you relief.
My best to you.
If you would, please fill out the feedback form after accepting. I appreciate this opportunity to help you out today. If I can be of further service to you, just put "for Anna" in the front of your new question, and I'll be the one to answer it.