Sahih al-Bukhari Book 75, Hadith 32
We went to pay a visit to Khabbab (who was sick) and he had been branded (cauterized) at seven
places in his body. He said, "Our companions who died (during the lifetime of the Prophet) left (this
world) without having their rewards reduced through enjoying the pleasures of this life, but we have
got (so much) wealth that we find no way to spend It except on the construction of buildings Had the
Prophet not forbidden us to wish for death, I would have wished for it.' We visited him for the second
time while he was building a wall. He said, A Muslim is rewarded (in the Hereafter) for whatever he
spends except for something that he spends on building."
The Prophet (ﷺ) said, "None of you should wish for death because of a calamity befalling him; but if he has to wish for death, he should say: "O Allah! Keep me alive as long as life is better for me, and let me die if death is better for me.' "
I heard Allah's Messenger (ﷺ) saying, "The good deeds of any person will not make him enter Paradise." (i.e., None can enter Paradise through his good deeds.) They (the Prophet's companions) said, 'Not even you, O Allah's Messenger (ﷺ)?' He said, "Not even myself, unless Allah bestows His favor and mercy on me." So be moderate in your religious deeds and do the deeds that are within your ability: and none of you should wish for death, for if he is a good doer, he may increase his good deeds, and if he is an evil doer, he may repent to Allah."