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