A person once got angry when he saw people worshipping a tree. He grabbed hold of an axe and intended to cut it down. On the way, he met Shaytaan. He told Shaytaan that he intended to cut the tree down. Shaytaan told him to leave it and let the tree worshipers face the consequences. Due to this disagreement, the pair wrestled twice. Shaytaan being beaten each time.
As Shaytaan soon realized this person is strong in his belief, he began to change his approach by saying that if you leave this tree, you will find gold coins under your pillow. The person hesitated for a while and thereafter agreed.
The person returned home and found the gold coins daily under his pillow every morning. Once, for two consecutive days, he never found the gold coins that were meant to be under his pillow. He proceeded again to the tree in a fit of anger. On the way, he met Shaytaan. Shaytaan asked, “Where are you going?” He replied, “To cut the tree down.”
Iblees (Shaytaan) then told him to return back as he was not going to allow him to proceed. They both started wrestling again and this time Shaytaan won. Iblees said, “On the first occasion, you wanted to cut down the tree for Allah, I couldn’t have stopped you but this time you are going due to the fact that you didn’t receive the gold coins (so you can only benefit yourself), for which I have stopped you.”
The moral to this story is that the actions which are done for Allah are difficult for Shaytaan to obstruct. When actions are done for yourself i.e. worldly things, then Shaytaan can win easily.