If you have anxious thoughts or even panic attacks, there is one technique I've learned over the years that works surprisingly well: I say to myself with disgust, "That's stupid."
It's the truth. When I am feeling anxious, the thoughts I'm thinking really are stupid. Pay attention next time you feel anxious, write down what you're thinking, and then later, when you're no longer feeling anxiety, look at what you wrote. You'll see that it was a stupid thing to think.
Learn more about how to use this technique: Cure for Self-Defeating Thoughts.