Hazrat Moulana Muhammad Ilyaas (rahmatullahi ‘alaih) once mentioned:

When any servant of Allah Ta‘ala wishes to carry out a righteous deed, Shaitaan tries to prevent him in different ways and places numerous obstacles and difficulties in his path. However, if all the obstructions and obstacles of Shaitaan fail to prevent him, and he succeeds in commencing the righteous deed, then Shaitaan begins a second effort. The second effort of Shaitaan is to corrupt the sincerity and purity of the servant’s action, or to try and claim a share of this righteous deed by making him do it not solely for Allah Ta‘ala. In other words, Shaitaan will make an effort to include ostentation and show into his intention and at times, create flaws in his intention on account of worldly motives, thereby destroying the purity of the action. Shaitaan is sometimes successful in the effort of corrupting the servant’s good deeds. It is thus essential for all those who are involved in any Deeni khidmat to be mindful of the plots of Shaitaan, to perpetually safeguard their hearts from his whispers, and to continuously examine their intention before carrying out any deed. The reason is that if one carries out any action with an intention besides earning the pleasure of Allah Ta‘ala, this action will not be accepted by Allah Ta‘ala. (Malfoozaat Hazrat Moulana Muhammad Ilyaas (rahmatullahi ‘alaih) pg.14-15)

Source: Ihyaauddeen.co.za