Evil whispers during prayer and at other times come from the Shaytaan, who is keen to misguide the Muslim and deprive him of good and keep it far away from him. One of the Sahaabah complained to the Messenger of Allaah (peace and blessings of Allaah be upon him) about waswaas during prayer, and he said: “The Shaytaan comes between me and my prayers and my recitation, confusing me therein.” The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “That is a devil called Khanzab. If he affects you seek refuge in Allah from him and spit drily to your left three times.” He [the Sahaabi] said, I did that and Allaah took him away from me.
(Narrated by Muslim, 2203)
Proper focus (khushoo’) is the essence of prayer. Prayer without proper focus is like a body without a soul. The following are two of the things that help one to develop the proper focus:
1 – Striving to think about what you are saying and doing, pondering the meanings of the Qur’aan, dhikr (words of remembrance) and du’aa’s (supplications) that you are reciting; bearing in mind that you are conversing with Allaah as if you can see Him. For when the worshipper stands to pray, he is speaking to his Lord, and ihsaan means worshipping Allaah as if you are seeing Him, and knowing that even though you cannot see Him, He sees you. Every time a person experiences the sweetness of prayer, he will be more inclined to do it. This depends of the strength of one’s faith – and there are many means of strengthening one’s faith. Hence the Prophet (peace and blessings of Allaah be upon him) said, “Of the things of your world, women and perfume have been made dear to me, and my joy is in prayer.” According to another hadeeth he said, “Let us relax, O Bilal, with prayer,” and he did not say, Give us a break from it.
2 – Striving to ward off the things that may distract you during prayer, namely thinking about things that are irrelevant or distracting. Waswaas affects each person differently, because waswaas has to do with a person’s level of doubts and desires and the degree to which a person is attached to other things or is fearing other things.
(From Majmoo’ Fataawa Shaykh al-Islam Ibn Taymiyah, 22/605)