It doesn't work. It is the opposite.
The more you try to resist or push away or separate from what you think is the thing you do not want, the more intense it will become, the more threatening it will appear, and the more you will be magnetized to it.
It is as though, as you pull away from it, using a psychological 'force' of withdrawal, you simultaneously create a great 'pull' of equal and opposite effect, which draws that very scary thing to you.
Perhaps you've had a dream, where in the dream you are afraid and are running away from someone who is chasing you. It seems that the more you fight to get away, the more versatile they become at closing in on you. Eventually, however, you might find (if you chose well) that you surrender the fight, and you stop running. What happens when you stop running? The person stops chasing. And not only do they stop chasing, but they stop seeming like they even wanted to catch up to you, and they don't even attack you. How about that? This is the mind symbolizing what is happening in the psyche when you become afraid - what you resist persists, until you stop resisting and then it literally becomes your friend instead of your enemy.
It is hilarious that, therefore, the very thing you are trying to get rid of, you are intensely CAUSING to come after you. The very thing you try to separate yourself from, tries to come closer to you. The very thing you don't want, seems to show up even more as though you want it very much. This is the simple functioning of the mind. You are literally creating your own enemies because intensifying the sense of separation between you and your enemy simultaneously renders them appearing to be an even stronger enemy.
Surrender is the antidote of fear, whereby you stop fighting with yourself and give up the pursuit of freedom from enemies, which causes you to be free from enemies. A paradox it seems, but this is how the mind works. Stop fighting and your enemies stop fighting you back. Stop attacking and your enemies stop being attackers. Stop fearing and things stop seeming so fear-inducing.