Yes, it is an established sunnah. The Prophet ﷺ taught that whoever commits a sin, then performs wudu well, prays two rakah, and seeks Allah's forgiveness, Allah will forgive him — echoing the description of the righteous in Surah Al Imran who, upon sinning, remember Allah and ask forgiveness. It is not obligatory but a highly recommended means of turning back to Allah after a fault.
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.