I heard Allah's Apostle ﷺ as saying three days before his death: None of you should court death but only hoping good from Allah
سَمِعْتُ النَّبِيَّ ﷺ قَبْلَ وَفَاتِهِ بِثَلاَثٍ يَقُولُ لاَ يَمُوتَنَّ أَحَدُكُمْ إِلاَّ وَهُوَ يُحْسِنُ بِاللَّهِ الظَّنَّ