Sunan an-Nasa'i 1820
سنن النسائي#1820SahihIt was narrated form Anas that the Messenger of Allah said:"None of you should wish for death because of some harm that befalls him, rather he should say: 'Allahumma ahini ma kanatil-hayatu khairanli wa tawaffani idha kanatil-wafatu khairanli (O Allah, keep me alive so alive so long as life is good for me, and cause me to die when death is good for me)
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Abu GhuddahSahih
Al-AlbaniSahih
Zubair Ali ZaiIsnaad Sahih
In-book reference: 21:3