Hisnul Muslim 140

Upon committing a sin

ما من عبد يذنب ذنبا فيحسن الطهور , ثم يقوم فيصلي ركعتين , ثم يستغفر الله إلا غفر الله له

There is not any slave of Allah who commits a sin, then he perfects his ablution and stands to pray two rak'ah of prayer, then seeks Allah's forgiveness, except that Allah will forgive him.