عَنْ جَابِرٍ رضي الله عنه قَالَ: سَمِعْتُ النَّبِيَّ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ قَبْلَ وَفَاتِهِ بِثَلَاثٍ يَقُولُ: «لَا يَمُوتَنَّ أَحَدُكُمْ إِلَّا وَهُوَ يُحْسِنُ بِاللهِ الظَّنَّ».
The Prophet (may Allah's peace and blessings be upon him) is urging Muslims not to die except while having good expectations of Allah by making their hope for Allah's mercy and pardon outweigh when being in a state of moribundity. Because fear is required to improve deeds; however, this is not a state for offering deeds. Hence, the prevalence of hope is required here.
Download for free and never miss a prayer again