I heard the Messenger of Allah ﷺ say regarding Ramadan, "Whoever stands in prayer during it out of faith and seeking reward will have his past sins forgiven."
أخبرنا الربيع بن سليمان قال حدثنا ابن وهب قال أخبرني يونس عن ابن شهاب قال أخبرني أبو سلمة بن عبد الرحمن أن
سمعت رسول الله ﷺ يقول في رمضان من قامه إيمانا واحتسابا غفر له ما تقدم من ذنبه
[ Its isnad is sahih, and it is in Sunan al-Kubra, no. 2504. Bukhari also related it, nos. 2008, 2014, as did Muslim, no. 174/759, from the hadith of Zuhri through this route.