A Muslim cannot be self-righteous or think highly of his faith or the good deeds he performs. Allah described the true believers:
“And they who perform virtuous acts while their hearts are trembling at the thought that they must return unto their Lord.” (Al-Mu’minun: 23: 60)
When `A’ishah, the beloved wife of the Prophet (peace be upon him), asked him: Does this verse refer to a person who steals or fornicates or drinks while fearing Allah?
The Prophet replied, “Not at all; rather it refers to someone who prays, fasts and offers chastity while fearing Allah!” (Al-Bukhari)
Allah also orders us not to practice self-righteousness:
“And do not, then, consider yourselves pure – [for] He knows best as to who is conscious of Him.” (An-Najm 53: 32)
We learn this lesson also from the story of the great Prophet Ibrahim and his son Ismaeel. Allah tells us in the Qur’an that when they built the Ka`bah, they supplicated to Allah as follows:
“Our Lord, accept this work of ours for certainly You are the All-Hearing, and the All-Knowing.” (Al-Baqarah 2: 127)
Therefore, we ought to continue to engage in introspection and pray to Allah for forgiveness, while praying to Him to accept our good deeds.
Now as for your second question, Allah tells us that whoever works for the good of this world diligently, he will reward him or her; as for those who work for the good of both worlds, they will gain both if they work hard.
Therefore, you cannot simply count on prayer alone for success. Prayer and work go hand in hand, neither is good without the other. Therefore, if you want to get a perfect score in your exam, you ought to put forth the best of your efforts and pray to Allah at the same time.
Almighty Allah knows best.
Views expressed by hosts/guests on this program (live dialogue, Facebook sessions, etc.) are their own and their appearance on the program does not imply an endorsement of them or any entity they represent.