i have dealt with unwanted intrusive thoughts for years, namely of the self-destructive or violent kind. your thoughts may be in a similar vein to this, or they might not. either way, the thing that has helped me the most is remembering that THOUGHTS DO NOT EQUAL REALITY!! your thoughts, no matter what they're about, are not at all representative of reality or who you are. what helps me is reminding myself of this, as well as making a habit of reacting neutrally to intrusive thoughts. if i have an unpleasant thought, i recognize that it's unpleasant and remind myself that it's just a thought. not all thoughts are important. but above all, DON'T ignore them and don't try to force them out of your mind!! this can be a form of repression, and ignoring intrusive thoughts tends to make them way worse. you are more than your thoughts, so recognize and acknowledge them before carrying on with your day.
Similarly to previous statements, I'd suggest you try to think of other things that make you feel better.
However, that doesn't always work, so another effective solution is for you to try to fill up your mind with activity as much as possible. Keep yourself busy for as long as you can, participate in a lot of activities, and spend time with positive people.
Personally, going out to run a mile or two always takes me out of my mind. It really depends on the person.
Best of luck with whatever you're through. I hope my advice was helpful. :)
Distract yourself. Find a hobby or something you enjoy and occupy your mind with it. You will eventually learn that this is a way to cope with whatever you're going through. It's called cognitive therapy, however, instead of getting professional support, you're learning for yourself what you can do to distract yourself and hide any negative thoughts.
I view those thoughts like clouds passing through my mind and let then go in the same way. I also meditate and practice mindfulness when they make me feel overwhelmed. I also talk to a friend or seek out help seevices like 7 Cups. For deeper unwanted thoughts and feelings I seek help from a professionals, such as a therapist, psychologist or life coach. When these unwanted thoughts are perssistant in being negative I practice making them positive. For example, if I feel and think I cannot do a task I ask myself how thinking like this will help me and I remind myself that I am strong and determined and I can do it if I put my mind to it.