Imam Al-Nawawi's Riyad-us-Saliheen
Chapter 67
Abomination of longing for Death

585. Abu Hurairah (May Allah be pleased with him) reported: Messenger of Allah (sallallaahu ’alayhi wa sallam) said, "None of you should wish for death. If he is righteous, perhaps he may add to (his) good works, and if he is a sinner, possibly he may repent (in case he is given a longer life).''
[Al-Bukhari].

     In Muslim, Abu Hurairah (May Allah be pleased with him) reported : Messenger of Allah (sallallaahu ’alayhi wa sallam) said, "Let none of you wish for death, nor he ask for it before it comes to him, because when he dies, his actions will be terminated; certainly the age of a (true) believer does not add but good.''  

Commentary: This Hadith forbids a believer to wish for his death as the longevity of his age suits him by all means. The longer he lives, the greater degree of progress will he make in virtues pursuits. And in case he infringes upon the Shari`ah rules, he may perhaps incline towards penitence. A believer should, therefore, consider his life as a boon and try his utmost to do good things.

586. Anas bin Malik (May Allah be pleased with him) reported: Messenger of Allah (sallallaahu ’alayhi wa sallam) said, "Let none of you wish for death on account of an affliction that befalls him. If he has no alternative, let him pray: `Allahumma ahyine ma kanatil-hayatu khairan li, wa tawaffani idha kanatil-wafatu khairan li (O Allah! Give my life so long as the life is good for me, and take away my life if death is good for me)'.''
[Al-Bukhari and Muslim].

Commentary:  Here, too, a believer has been prevented from wishing for death. Because it betrays that he is far from agreeing to what Allah wills or has ordained. If at all his wishing becomes intense and indispensable under the pressure of circumstances, he should pray in the Prophetic words mentioned in the Hadith above.

587. Qais bin Abu Hazim (May Allah be pleased with him) reported: I went to visit Khabbab bin Aratt (May Allah be pleased with him) during his illness. He had been cauterized in seven places. He said: "Our companions who have died have left (this world) without having enjoyed the pleasures of the world (in order to get a great full reward in the Hereafter) while we have amassed wealth exceeding our needs for which there is no place to keep except in the earth. Had Messenger of Allah (sallallaahu ’alayhi wa sallam) not prohibited us from longing for death, I would have prayed for it.'' Then we visited him again and he was building a wall. He said: "There is a reward in store for a Muslim in respect of everything on which he spends except for something he places in the earth (i.e., something exceeding our needs or essentials).''
[Al-Bukhari and Muslim].

Commentary:  This Hadith forbids a believer to wish for his death as the longevity of his age suits him by all means. The longer he lives, the greater degree of progress he will make in the pursuit of virtues. And in case he infringes upon the Shari`ah rules, he may perhaps incline towards penitence. A believer should, therefore, consider his life as a boon and try his utmost to do good things .