So whenever you get this erry thought practice this technique
Stop : Commanding the thought to stop
Drop : After stopping it dropping the obsessive thought is also important
Relax : Inhale and exhale deeply
Divert: Engage in some activity or some good time
Hope this helps you. Practicing will make it habit and your mind will be reprogrammed to think rationally
Till my next post keep practicing.