are better with your Lord in reward and better in hope.” (al-Kahf 46)
Therefore, if you remain alive—even while suffering harm or hardship—you may well accumulate additional good deeds. And if you are a sinner who has done wrong, perhaps you will seek iʿtāb (reconciliation), that is, you will implore Allah for acceptance and pardon, and then die having repented of your misdeeds. So do not wish for death, for every matter has already been decreed, and it may be that your staying alive is good for you—or good for you and for others. Do not wish for death; rather, be patient and seek your reward, for no condition endures forever. Allah is the One who grants success.
2/586 – Anas (may Allah be pleased with him) reported that the Messenger of Allah (peace and blessings be upon him) said: “None of you should wish for death because of a calamity that has befallen him. If he must do so, then let him say: ‘O Allah, keep me alive so long as life is better for me, and take me when death is better for me.’” Agreed upon.
3/587 – Qays ibn Abī Ḥāzim said: We visited Khabbāb ibn al-Aratt (may Allah be pleased with him) while he had been cauterized seven times. He said, “Our companions who have gone before us departed, and the world did not diminish them in the least, whereas we have acquired wealth for which we find no place except the earth itself. Were it not that the Prophet (peace and blessings be upon him) forbade us to pray for death, I would have asked for it.”
We visited him again on another occasion while he was building a wall, and he said, “A Muslim is rewarded for everything he spends except for what he places in this soil.” Agreed upon; this is the wording and narration of al-Bukhārī.