Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.015A.

Section : Desirability of Having a Good Opinion about Allah.

The patient should remember the boundless mercy of Allah and have a good opinion about his Sustainer. Jabir reported: “I heard the Messenger of Allah, peace be upon him, saying, three nights before his death, ‘Let none of you die unless he has a good opinion of Allah’.” (Muslim) This hadith encourages the triumph of hope and expectation of forgiveness when one meets Allah, the Exalted. One should be in the state most loved by Allah, since He is the most Gracious, the most Merciful, the most Beneficent, and the most Generous. He loves to forgive those with hope. In the words of a hadith: “Everyone will be raised on the Resurrection Day in the condition in which he died.”

It is reported by Anas that “the Prophet, peace be upon him, went to see a young man who was on his deathbed. The Prophet, peace be upon him, asked him: ‘How are you?’ The young man said: ‘I hope for Allah’s pardon, but I am fearful because of my sins.’ The Prophet, peace be upon him, said: ‘These two things never gather in the heart of a person at such a time without Allah granting him what he hopes for and sheltering him from what he dreads’.” (Ibn Majah and Tirmizhi)