The Messenger of Allah ﷺ said, "Whoever fasts during Ramadan and stands in prayer through its nights out of faith and seeking reward will have his past sins forgiven, and whoever stands in prayer on Laylat al-Qadr out of faith and seeking reward will have his past sins forgiven."
حدثنا يزيد أخبرنا محمد عن أبي سلمة
قال رسول الله ﷺ من صام رمضان وقامه إيمانا واحتسابا غفر له ما تقدم من ذنبه ومن قام ليلة القدر إيمانا واحتسابا غفر له ما تقدم من ذنبه