Well this is how I approach the subject.
Thoughts come and go all day for the simplest of reasons which can start as pure or business oriented or whatever, even as prayers. However, once a thought enters your conscience, and begins to take shape and form your thinking at that moment in time, and in that process, you realize that this thought, which again may have had an innocent event trigger the thought, but none the less, once you realize this thought is moving into areas which will lead you to further thoughts that, if acted upon would be sin, then at that moment of recognition of the thought, I take action by saying the prayer to St. Michael the Archangel, and/or simply repeating slowly “Jesus and Mary help me”.
My goal is to redirect my thoughts back into a proper course which does not lead to sin.
These thoughts may be a focus of anger against someone. A thought of “how to” secure vengence. A thought of lust. A thought of pride, such as “I am better than so-and so”. Any myriad of thoughts, which if you continue giving them life in your mind, will only lead to having “mentally” designed a sin which at the moment is without physical action, but which if you continue to “design” this sinful thought, could manifest itself into action.
So, as soon as I come to the understanding of the direction my thoughts have taken me, I corral them back into a Christian reference by calling on St. Michael first, as I view these thoughts as “the day of battle” and the prayer to St. Michaels requests his help in “the day of battle”. Generally, I win very quickly calling on his assitance. On the few occassions were the thought presists, I call on Jesus and Mary.
Sin thoughts become sinful only when you embide them and relish in them and feed them and continue to pursue them. Kill them as quickly as the come, and it is not sinful, just a distraction.