When a person sins and then sincerely turns to Allah for forgiveness, one will find Allah ready to accept his repentance and to forgive him, as this verse indicates:
Ama u dambi-dhaaf warso ama ha u dambi-dhaaf warsanin, haddaad u dambi-dhaaf warsato toddobaatan jeer uma dambi-dhaafo Eebbe, illeen iyagu waxay ka gaaloobeen Eebbe iyo Rasuulkiisa, Eebbana ma hanuuniyo qawmka faasiqiinta ah.