Abu Hurairah reported,

The Prophet ﷺ said, "Whoever fasts Ramadan out of faith and seeking reward, his previous sins will be forgiven, and whoever stands in prayer during Laylat al-Qadr out of faith and seeking reward, his previous sins will be forgiven."

Azami 4309

Sahih

عن أبي هريرة

عن النبي ﷺ قال: من صام رمضان إيمانا واحتسابا، غفر له ما تقدم من ذنبه، ومن قام ليلة القدر إيمانا واحتسابا غفر له ما تقدم من ذنبه.

الأعظمي 4309صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Obligation of fasting, its virtue, and its rulings
Section
Virtue of fasting the month of Ramadan
Numbering
Jami al-Kamil 4309 (2nd edition)
Azami 4309