It is not permissible to wish for death
➊ It is narrated from Anas (may Allah be pleased with him) that the Messenger of Allah ﷺ said:
لا يتمنين أحدكم الموت لضر نزل به
“None of you should ever wish for death because of a hardship or affliction that has befallen him.”
And if he must wish for it, then let him say:
اللهم أحيني ما كانت الحياة خيرا لي وتوفنى ما كانت الوفاة خيرا لي
“O Allah! Keep me alive as long as life is better for me, and cause me to die when death is better for me.”
➋ In one narration, Abbas (may Allah be pleased with him) wished for death while he was ill, so the Prophet ﷺ said:
يا عم لا تمن الموت
“O uncle! Do not wish for death.”
“Because if you are righteous, you will increase in your good deeds (in the rest of your life), and that is better for you; and if you are a sinner, you can repent of your sins, and that too is better for you. So do not ever wish for death.”