For example, one may say, “O Allah, if You keep any of us alive, keep him alive upon Islam, and if You cause any of us to die, cause him to die upon faith.” Life is coupled here with Islam, which is outward submission, whereas death is linked to faith because faith is superior and resides in the heart. In the end the reckoning depends on what is in the heart at the moment of death and on the Day of Resurrection.
Another supplication is: “O Allah, do not deprive us of his reward and do not subject us to trial after him.” “Do not deprive us of his reward” refers to the reward for performing the funeral prayer, for a person who attends until the prayer is offered receives one qirāt, and whoever stays until the burial receives two qirāts. There is also a separate reward for the bereaved relative or friend who grieves over the loss; he is rewarded for his patience with the calamity. “Do not subject us to trial after him” means: do not let us go astray in our religion after his passing, for so long as a person’s soul has not yet departed he remains exposed to trials in his faith—Allah’s protection is sought. For this reason the Prophet ﷺ taught, “do not subject us to trial after him,” and a Muslim ought to recite this supplication in emulation of the Messenger of Allah ﷺ.
As for the ḥadith of Abū Hurayrah in which the Prophet ﷺ said, “When you pray for the deceased, make your supplication sincere for him,” its import is that you should pray with a present heart, earnestly pleading with Allah on behalf of your deceased brother, for he is in need of your supplication. Allah alone grants success.