From Quran
وَمَن يَعۡمَلۡ سُوٓءًا أَوۡ يَظۡلِمۡ نَفۡسَهُۥ ثُمَّ يَسۡتَغۡفِرِ ٱللَّهَ يَجِدِ ٱللَّهَ غَفُورٗا رَّحِيمٗا
النساء/110 .
And whoever does evil or wrongs himself but afterwards seeks Allah’s Forgiveness, he will find Allah Oft-Forgiving, Most Merciful.
An-Nisāʾ: 4:110
Hadith: Arabic Text followed by English Translation.
عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم
وَالَّذِي نَفْسِي بِيَدِهِ لَوْ لَمْ تُذْنِبُوا لَذَهَبَ اللَّهُ بِكُمْ وَلَجَاءَ بِقَوْمٍ يُذْنِبُونَ فَيَسْتَغْفِرُونَ اللَّهَ فَيَغْفِرُ لَهُمْ
رواه مسلم ٢٧٤٩
Abu Huraira reported Allah’s Messenger (ﷺ) having said:
By Him in Whose Hand is my life, if you were not to commit sin, Allah would sweep you out of existence and He would replace (you by) those people who would commit sin and seek forgiveness from Allah, and He would have pardoned them.
Narrated by Muslim, 2749