Sahih al-Bukhari 6351
Book 80: Invocations · Narrated by Anas
Arabic
حَدَّثَنَا ابْنُ سَلاَمٍ، أَخْبَرَنَا إِسْمَاعِيلُ ابْنُ عُلَيَّةَ، عَنْ عَبْدِ الْعَزِيزِ بْنِ صُهَيْبٍ، عَنْ أَنَسٍ ـ رضى الله عنه ـ قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " لاَ يَتَمَنَّيَنَّ أَحَدٌ مِنْكُمُ الْمَوْتَ لِضُرٍّ نَزَلَ بِهِ، فَإِنْ كَانَ لاَ بُدَّ مُتَمَنِّيًا لِلْمَوْتِ فَلْيَقُلِ اللَّهُمَّ أَحْيِنِي مَا كَانَتِ الْحَيَاةُ خَيْرًا لِي، وَتَوَفَّنِي إِذَا كَانَتِ الْوَفَاةُ خَيْرًا لِي ".
English translation
Narrated Anas:Allah's Messenger (ﷺ) said," None of you should long for death because of a calamity that had befallen him, and if he cannot, but long for death, then he should say, 'O Allah! Let me live as long as life is better for me, and take my life if death is better for me
Reference: Sahih al-Bukhari 6351, Book of Invocations. English translation by Dr. Muhammad Muhsin Khan.