I heard the Messenger of Allah ﷺ say, "No one's deeds will admit him into Paradise."They asked, "Not even you, Messenger of Allah?"He replied, "No, not even me, unless Allah covers me with His grace and mercy. So aim for what is right, draw near to it, and let none of you wish for death. If he is a doer of good, perhaps he will increase in goodness, and if he is a wrongdoer, perhaps he will seek to make amends."
سمعت رسول الله ﷺ يقول: لن يدخل أحدا عمله الجنة قالوا: ولا أنت يا رسول الله؟ قال: لا، ولا أنا، إلا أن يتغمدني الله بفضل ورحمة، فسددوا، وقاربوا، ولا يتمنين أحدكم الموت، إما محسنا فلعله أن يزداد خيرا، وإما مسيئا فلعله أن يستعتب.
Bukhari narrated it in the Book of the Sick (5673), from Abu Yaman, who said, Shuayb informed us, from Zuhri, who said, Abu Ubayd, the freedman of Abdul-Rahman bin Awf, informed me that Abu Hurairah said, and then he related it.Muslim narrated it in the Book of the Attributes of the Hypocrites (2816) through the route of Ibn Shihab with his chain, and through many other routes, except that he did not mention in it the prohibition against wishing for death.