The Messenger of Allah ﷺ said, "Whoever fasts Ramadan and stands in prayer during it out of faith and seeking reward will have his past sins forgiven, and whoever stands in prayer during Laylat al-Qadr out of faith and seeking reward will have his past sins forgiven."This is a sound hadith.
حدثنا هناد حدثنا عبدة والمحاربي عن محمد بن عمرو عن أبي سلمة
قال رسول الله ﷺ من صام رمضان وقامه إيمانا واحتسابا غفر له ما تقدم من ذنبه ومن قام ليلة القدر إيمانا واحتسابا غفر له ما تقدم من ذنبه هذا حديث صحيح
Its chain is hasan. Ibn Majah also narrated it in "Establishing the Prayers," in the chapter on what has been mentioned about standing in prayer during the month of Ramadan, hadith 1326, from the hadith of Muhammad bin Amr bin Alqama Laythi, through the same route, and Ibn Hibban graded it sahih (Al-Ihsan) 3674. Its basic content is agreed upon, Bukhari, hadith 2014, and Muslim, hadith 759.