(44) Chapter: Upon committing a sin
(44) ما يقول ويفعل مَنْ أذنبَ ذنباً
Hisn al-Muslim 140
There is not any slave of Allah who commits a sin, then he perfects his purification and stands to pray two Rak'ahs of prayer, then seeks Allah's forgiveness, except that Allah will forgive him.
Reference: Abu Dawud 2/86, At-Tirmidhi 2/257. Al-Albani graded it authentic in Sahih Abu Dawud 1/283.
مَا مِنْ عَبْدٍ يُذنِبُ ذَنْباً فَيُحْسِنُ الطُّهُورَ، ثُمَّ يَقُومُ فَيُصَلِّي رَكْعَتَيْنِ، ثُمَّ يَسْتَغْفِرُ اللَّهَ إِلاَّ غَفَرَ اللَّهُ لَهُ.
Reference: Hisn al-Muslim 140