I experienced this, and I dealt with mine with:
- Acknowledging not me, just a thought
- Focusing back on whatever I was at the time of experience or force self to think of any thing else
- saying "next" to myself to show I have control over and dismissing and that don't rule me.
Did this over and over, and the intrusive thoughts had less and less affect on me.
Probably still have them, but at least it leaves me to be able to move forward and find the root cause of. But no longer do I question my self/insanity etc.
When my GF shared with me the description of this and I could see how affected her, I explained it wasn't her, and how I dealt with it and how the mind works. She never did give me the report back on that actually, lol (i'll find out in a bit), but I'm pretty sure that was the start of her journey of personal growth

Make a conscious, even verbal statement that you're gonna deal with it, and that it doesn't control you, you won't let it.

This is how I dealt with mine any way. Whilst I have no clue of the effect or lasting result, and probably should read more into the material on obsessive thoughts etc, I do have my OWN theoretical models of what causes what problems so I don't do my own thing half blind, I have worked through a lot of my own issues though.
BUT I "warn(?)" you , or anyone else reading what I did to stop mine,
that even if it makes sense to you, you have to think twice about doing it, because you're responsible for you, not me, and I only share this as my experience and i'm not someone who has all the answers. I'm just willing to try and figure things out, instead of being told what I should do. (when they're really saying "let's try")
I'm a guinea pig for no one other than myself. :P
Goodluck!! (Learning about the mind in general, helped me a lot)
PS Some GP do have some understanding of some mental health problems, OCD being a pretty common one actually, I would be suprised if your doctor was clueless, they can always refer you to someone who isn't though.
PPS Just want to really say, your thoughts, those thoughts, aren't you! They're not!