I heard Allah's Apostle (ﷺ) as saying three days before his death: None of you should court death but only hoping good from Allah
Sahih Muslim Book 53, Hadith 98