Rebbe Nachman once remarked that the Evil One is a sly character. He comes knocking on your mind. If you allow him to enter, he comes in and takes over, and if you repel him, he goes away and comes knocking again later on. But if you keep up the battle and not give in, he will eventually go away and not return (Likutei Moharan II: 51).
Thoughts enter and leave quickly – very quickly. If they are given credence, they remain, but, if they are shrugged off and considered of no value, they will have been successfully chased away.
Chaim Kramer, Crossing the Narrow Bridge