حَدَّثَنَا عَبْدُ الْأَعْلَى ، حَدَّثَنَا مُعْتَمِرٌ ، قَالَ : سَمِعْتُ حُمَيْدًا يُحَدِّثُ عَنْ أَنَسٍ ، عَنِ النَّبِيِّ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ ، أَنَّهُ قَالَ : لَا يَتَمَنَّيَنَّ أَحَدُكُمُ الْمَوْتَ لِضُرٍّ نَزَلَ فِيهِ فِي الدُّنْيَا ، وَلَكِنْ لِيَقُلِ : اللَّهُمَّ أَحْيِنِي مَا كَانَتِ الْحَيَاةُ خَيْرًا لِي ، وَتَوَفَّنِي إِذَا كَانَتِ الْوَفَاةُ خَيْرًا لِي .
It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "None of you should ever wish for death because of some harm that has befallen him in the world. Rather, if he must say something, let him say: 'Allahumma ahyini ma kanat al-hayatu khayran li, wa tawaffani idha kanat al-wafatu khayran li' (O Allah, keep me alive as long as life is better for me, and grant me death when death is better for me)."