Anas (b. Malik) reported Allah's Messenger (ﷺ) as saying. None of you should make a request for death because of the trouble in which he is involved, but if there is no other help to it, then say: O Allah, keep me alive as long as there is goodness in life for me and bring death to me when there is goodness in death for me.
Hadith Referenceصحيح مسلم / كتاب الذكر والدعاء والتوبة والاستغفار / 2680
Nadr bin Anas reported, as when Anas was alive, that he said: Had Allah's Messenger (ﷺ) not stated this.." None should make a request for death," I would have definitely done that.
Hadith Referenceصحيح مسلم / كتاب الذكر والدعاء والتوبة والاستغفار / 2680
Abu Hazim reported: I visited Khabbab who had seven cauteries on his stomach and he said: Had Allah's Messenger (ﷺ) not forbidden us to call for death, I would have done so.
Hadith Referenceصحيح مسلم / كتاب الذكر والدعاء والتوبة والاستغفار / 2681
Hammam bin Munabbih said: Abu Hurairah (RA) narrated to us ahadith from Allah's Messenger (ﷺ) and out of these, one is that Allah's Messenger (ﷺ) said: None amongst you should make a request for death, and do not call for it before it comes, for when any one of you dies, he ceases (to do good) deeds and the life of a believer is not prolonged but for goodness.
Hadith Referenceصحيح مسلم / كتاب الذكر والدعاء والتوبة والاستغفار / 2682