The fastest way to sink in quicksand is to panic.
Ironically, the movements you feel most compelled to make when you find yourself sinking, are the very moves that sink you the quickest. The best course of action is to breathe deeply, remain calm and work with the process to help you find a level of buoyancy.
There's a similar course of action to defeat unhelpful thoughts.
Many of us, when we recognise that we feel stuck in the troubling thoughts that spin around in our minds, respond in a panic to try and force the thought to stop, to go away and to leave us alone. We try and argue with it, pretend it isn't there, run away from it and wonder why it continues to grow.
But the best way to beat these thoughts is to be okay with them being there. When we refuse to attach emotion to the thought we don't like, we starve that thought of the oxygen it thrives on. When you go long enough without feeding it what it requires to grow, it will die.
But it works.
Some things are best fought by relaxing.