The Messenger of Allah ﷺ said, "None of you will be saved by his deeds."They asked, "Not even you, Messenger of Allah?"He replied, "Not even I, unless Allah covers me with His mercy. So aim for what is right, draw close to it, travel in the morning and the evening, and a portion of the night. Moderation, moderation, and you will reach your goal."
قال رسول الله ﷺ: لن ينجي أحدا منكم عمله قالوا: ولا أنت يا رسول الله؟ قال: ولا أنا إلا أن يتغمدني الله برحمة. سددوا، وقاربوا، وروحوا، وشيء من الدلجة، القصد القصد تبلغوا.
Bukhari narrated it in the Book of Raqaiq (6463), and Muslim in the Book of the Characteristics of the Hypocrites (2816), both through chains from Abu Hurairah, and the wording given here is Bukhari's, while Muslim's wording is close to it. In other narrations of Bukhari there is an addition, the prohibition against wishing for death, which is mentioned in the Book of Funerals.