How to Banish Negative Thoughts

Who doesn’t have negative thoughts now and then? But what if you had a negative thought which was pervasive and constant? Would you know how to get rid of it?