Easier said than done. As a person that has struggled with anxiety, I can honestly say that intrusive thoughts are a real thing for me.
While your advice is spot-on, it can be really hard just to "not think". Brains are stupid and don't always function on command, unfortunately. If there is any hint of evidence to support Freud's theory of a "death drive", intrusive thoughts would be it.