Anas bin Malik reported,

The Prophet ﷺ said, "None of you should wish for death because of some hardship that has befallen him. But if he must do so, then let him say, 'Allah, keep me alive so long as life is better for me, and take me when death is better for me.'"Except that he said, "because of some hardship that has come down upon him."

Ahmad 13166

Sahih

حدثنا روح حدثنا شعبة قال سمعت علي بن زيد وعبد العزيز بن صهيب قالا سمعنا أنس بن مالك يحدث بمثله إلا أنه قال من ضر نزل به

أحمد 13166صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 13166
Ahmad 13166