Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:
Whoever fasts the month of Ramadan due to faith and seeking reward, his previous sins will be forgiven. Whoever stands in prayer during the Night of Decree due to faith and seeking reward, his previous sins will be forgiven.
Source: Ṣaḥīḥ al-Bukhārī 1901, Grade: Muttafaqun Alayhi