hi there, i have read about ur problem and i can understand what u mean there.
Thinking is a process under the influence of a lot of things, such as stress, presence of difficult social situation or even inherent anxiety traits/ personality or even normal !
There is nothing wrong about thinking bcoz its a basic human quality. We will think till the day we dont cease to exist as humans. Thinking about anything will only reveal the importance of that thing. Brain does not know beforehand what to think about and what not. If i say dont think about a horse......and just observe that an image of a horse suddenly appeared in ur head. Dats how brain works !
Problem part is when we can not control the duration and attention we give to a particular thought. This becomes an illness if it persists for sometime and it starts to take most of our time and affects our functioning. So if this is the case u shud consult a psychiatrist so dat the extent and magnitude of ur problem can be comprehended and managed at a individual level.
I hope this helps u and dont feel shy to have any further queries at any point in time.