is this? Are the dates of Khaybar eaten like this?” They answered, “No, by Allah, O Messenger of Allah. We buy a sāʿ of this for two sāʿs, or two for three.” The Messenger of Allah (peace and blessings be upon him) said, “Do not do that. Instead, sell the inferior dates for silver, then purchase with that silver choice dates,” meaning good-quality fruit. Thus, when he prohibited the transaction, he also pointed out the lawful alternative.
In the same way he said: “None of you should wish for death because of some harm that has struck him. If he must do something, let him say: ‘O Allah, keep me alive as long as You know that life is better for me, and cause me to die when You know that death is better for me.’”
He has opened a door for you—but a sound, safe door. Longing for death reveals a person’s irritation and lack of patience with Allah’s decree, whereas this supplication—“O Allah, keep me alive as long as You know life to be good for me, and cause me to die when You know death to be good for me”—entrusts one’s affair to Allah. A human being does not know the unseen, so he hands the matter over to the One who does: “Keep me alive as long as You know life is good for me, and cause me to die when You know death is good for me.”
Wishing for death is a person’s haste in asking Allah to end his life, and he may thereby deprive himself of abundant good—he might miss the chance to repent or to increase in righteous deeds. Hence the hadith states: “No one dies except that he regrets it: if he was a doer of good, he regrets not having increased; and if he was a wrongdoer, he regrets not having sought ʿutbā,” that is, not having begged pardon for his sin.