Don’t even try. By giving them any attention at all you empower them, lending them more room in your head to bully you with.
So DO NOT try to stop bad thoughts.
Just turn your attention elsewhere, starving bad thoughts of attention while feeding your mind friendlier thoughts; not “positive thoughts” which you do not believe, but pleasant memories, comforting truths or reveries.
Finally, if anxious thoughts keep bugging you, breathe them in, imaging you are purifying the air like a fire-breathing dragon in reverse. This is a form of Tonglen, a powerful Buddhist practice which reminds us that we are bigger than whatever thoughts besiege us.