Hakeemul Ummah Hazrat Moulana Ashraf Ali Thaanwi Sahib رحمه الله has said that evil thoughts are a blessing in disguise. The reason being that when one is confronted with stray thoughts, this creates a ‘guilt’ in the mind and has a massive impact on the nafs.
Therefore, when one is overcome by evil thoughts, be grateful and do not become worried. Evil thoughts are harmless unless acted upon. The important condition being that evil thoughts come involuntarily. This is not blameworthy. However, if one deliberately brings into his mind evil thoughts; this is inappropriate and sinful.

