Sorry to hear about the difficulty you are facing. They sound distressing. When we feel our own thoughts are both under our control it can be a frightening experience.
This experience is common and can be solved.
Next Steps
Consult a Psychiatrist as there is a potential Mental Disorder that needs to be diagnosed and may or may not need medication. This decision is an important one.
Health Tips
Try not to yield to the urges and also find a way of distracting through activities.