´It was narrated that Abu Kabshah Al-Anmari said:` “The Messenger of Allah (ﷺ) said: ‘The likeness of this nation is that of four people: A man to whom Allah gives wealth and knowledge, so he acts according to his knowledge with regard to his wealth, spending it as it should be spent; a man to whom Allah gives knowledge, but he does not give him wealth, so he says: “If I had been given (wealth) like this one, I would have done what (the first man) did.” The Messenger of Allah (ﷺ) said: ‘They will be equal in reward. And a man to whom Allah gives wealth but does not give knowledge, so he squanders his wealth and spends it in inappropriate ways; and a man to whom Allah gives neither knowledge nor wealth, and he says: “If I had (wealth) like this one, I would do what (the third man) did.” The Messenger of Allah (ﷺ) said: ‘They are equal in their burden (of sin).’”
➊ If a person has the desire to perform a good deed but, due to some excuse, is unable to do so, he will receive a reward because of his good intention.
➋ If someone attempts to do a good deed but, due to some obstacle, is unable to complete it, he will still be deserving of reward.
➌ If one has the desire to commit a sin but is unable to do so, or tries to commit the sin but does not succeed, he is still considered sinful.
➍ If the desire to commit a sin arises in the heart, but one refrains from committing it for the sake of Allah’s pleasure, then he will be rewarded.
➎ Love for good deeds and hatred for evil, as well as love for those who do good and hatred for those who do evil, are also causes for reward.
Source: Commentary on Sunan Ibn Mājah by Mawlānā ‘Atā’ullāh Sājid, Page: 4228