This was me for ever.
Don't do it. Don't even bother letting those thoughts finish. Push that dumb shit away.
You'll be happier without all of that's nonsense. It can take a long time too, but it's immensely better when you realize you haven't entertained thoughts like that in a while.
You can, it's just really fucking hard. One of the best things I learned in therapy is how to push these thoughts away. I thought for a long time that it was impossible, until I learned different methods and really put some effort into learning it
That's how i was for years and years. It's not easy to turn those thoughts away it takes a lot of consistent work. Every time, kill the thought in it's tracks. Every time.
Eventually you will notice your progress.
You can change. It takes hard work. But you can change.