The heart-stirrings of a good man are good; those of a wicked person are wicked; but everyone must learn how to combat intrusive thoughts, and turn the bad into good. This is the mark of the soul that is well versed.
How does this come about you will ask?
Here is the way of it: just as a man knows when he is cold or when he feels hot, so does the man who has experienced the Holy Spirit know when grace is in his soul, or when evil spirits approach.
The Lord gives the soul understanding to recognize His coming, and love Him and do His will. In the same way the soul recognizes thoughts which proceed from the enemy, not by their outward form but by their effect on her. This is knowledge born of experience, and the man with no experience is easily duped by the enemy.
~Saint Silouan of Mount Athos