Al-Husayn b. Bistam narrated from Muhammad b. Khalaf from Ibn ‘Ali b. al-Washsha’ from ‘Abd Allah b. Sinan who said: A man complained to Abu ‘Abdallah, peace be upon him, of an abundance of desire (al-tammani) and temptation. He [Abu ‘Abd Allah] said: ‘Pass your hand over your chest and say: “In the Name of Allah, and by Allah, Muhammad is the Messenger of Allah, and there is no power or strength except with Allah, the Most High, the Mighty. O Allah, remove from me what I fear.” Then pass your hand over your belly and repeat it thrice Allah, the Exalted, will remove and turn it away from you.’
The man said: I would often break my prayer because of it being marred by desires and temptation. Then I did as my lord and master instructed me, three times, and Allah turned it away from me and cured me of it so that I did not experience it after that.
From al-Mufaddal b. ‘Umar from Abu ‘Abd Allah, peace be upon him, who said: ‘Zayn al-‘Abidin, peace be upon him, would protect his family with this invocation and teach it to his intimates. Place your hand on your mouth and say: “In the Name of Allah, in the Name of Allah, in the Name of Allah, and by God's handiwork, who has created everything very well. He is Aware of the things you do (27:88).”
Then say seven times: “Subside, O pain, I ask you by Allah, my Lord and your Lord and the Lord of everything in Whom trust what is in the night and the day, and He is the All-hearing, the All-knowing.”’