Negative thoughts are a habit. And as such, so are positive thoughts.
The more you practice one, the less the other grows.
Which would you rather invest your energy in?
Every time you hear a negative thought that does not support the life you want say, “thanks for sharing”, and move on.
There are many other techniques, find the one that works for you.