This is illustrated in his saying: “Perhaps a fasting person obtains nothing from his fasting but hunger and one who stands during the night in prayer nothing but tiredness.” [Reported by Ibn Majah from Abu Hurayrah. Shaykh al-Albani declared it to be authentic in Sahih ul-Jami’, no. 3482.]
Allah the Exalted said:
“And We shall turn to whatever actions they did and make them into scattered dust.” [Al-Furqan 25:23]
“It is he who created life and death to see which of you is best in action.” [Al-Mulk 67:2]
Therefore, know before everything else the necessary conditions for actions before they are accepted. It is vital that two great and important matters are fulfilled for every action. If they are not the action will not be accepted:
That the one who performed the action desired nothing but the Face of Allah by it.
That the action is in agreement with what Allah the Exalted has legislated in His Book or His Messenger has explained in his Sunnah.
Fudayl ibn Ayyad, a tabi’i, said regarding the verse, “… that He may test you, which of you is best in deeds …” [Hud 11:7], “The most sincere and the most correct” so those who were around him said, “And what is the most sincere and the most correct?” He replied, “Action, if it is correct but not sincere will not be accepted and action, if it is sincere but not correct, will not be accepted until it is both sincere and correct. Sincere means that nothing but the Face of Allah is sought and correct means that it is in conformity with the Sunnah.”
Moreover, some of the salaf used to say, “There is no action, even if it is insignificant, except that it will have two questions put to it: Why did you do it? And: How did you do it?”
The first question is about the reason for the action and its motive. If the motive was for an objective from among the objectives of the world such as seeking praise or status or any other worldly aim, it is an evil action and will be thrown back at its performer. If the motive for the action was to fulfil the right of Allah of pure enslavement to Him and seeking a means of nearness to Him then it is a good action and will be accepted insha’ Allah.
The second question is about the following and imitation of the Messenger. Was the action from amongst the legislated actions or was it from your innovation and invention? If it was from the guidance of the Messenger then it is a good action and if it was in opposition to the practice of the Messenger then it is an evil action and will not be accepted from its performer as is proven in the hadith of ‘A’ishah who reported that the Messenger of Allah said, “Whoever introduces into this affair of ours something that does not belong to it will have it rejected.” [Muslim]
And she also reports that the Messenger of Allah said, “Whoever does an action which we have not commanded will have it rejected.” [Muslim]
When one of the above two conditions is not fulfilled the action is neither righteous nor acceptable. The saying of the Blessed and Exalted provides evidence for this:
“And whoever places his hope in the meeting with His Lord let him work righteous deeds and in the worship of His Lord, associate none as a partner.” [Al-Kahf 18:110]
Allah, the Sublime, has commanded in this verse that the action should be righteous meaning, agreement with the shari’ah. Then He commanded that the person should make it sincerely for Allah, desiring by it nothing besides Him.
Al-Hafidh ibn Kathir said, “These are the two pillars of the accepted action. It is necessary that the action is sincerely for Allah and also correct, upon the shari’ah of the Messenger of Allah.” The likes of this have also been reported from al-Qadhi Iyyad, may Allah have mercy upon Him, and others.
Allah, the Exalted, also said:
“And who is better in religion than the one who submits his face to Allah and is a doer of good?” [Al-Nisa’ 4:125]
The meaning of submitting one’s face for Allah is making one’s intention and action for Allah, and the meaning of doing good is imitating and following the Messenger’s Sunnah.
Adapted with necessary editorial adjustments from Kitab ul-Ikhlas [The Book of Sincerity].Soucre Link