Jabir reported:I heard Allah's Apostle (ﷺ) as saying three days before his death: None of you should court death but only hoping good from Allah
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، أَخْبَرَنَا يَحْيَى بْنُ زَكَرِيَّاءَ، عَنِ الأَعْمَشِ، عَنْ أَبِي سُفْيَانَ، عَنْ جَابِرٍ، قَالَ سَمِعْتُ النَّبِيَّ صلى الله عليه وسلم قَبْلَ وَفَاتِهِ بِثَلاَثٍ يَقُولُ " لاَ يَمُوتَنَّ أَحَدُكُمْ إِلاَّ وَهُوَ يُحْسِنُ بِاللَّهِ الظَّنَّ " .
Muslim
The Book of Paradise, its Description, its Bounties and its Inhabitants • Hadith 98