Ibn Umar reported: The Prophet, peace and blessings be upon him, said, “Verily, Allah accepts the repentance of his servants, as long as they are not on their death bed.”

Source: Sunan al-Tirmidhī 3537; Grade: Hasan (fair) according to Al-Tirmidhi عَنْ ابْنِ عُمَرَعَنْ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ إِنَّ اللَّهَ يَقْبَلُ تَوْبَةَ الْعَبْدِ مَا لَمْ يُغَرْغِرْ 3537 سنن الترمذي كتاب الدعوات باب في فضل التوبة والاستغفار وما ذكر من رحمة الله لعباده; 5/507 المحدث الترمذي خلاصة حكم المحدث حسن في سنن الترم
Prophet Muhammad (ﷺ) said: Regret is repentance, And the one who repents is like one who did not sin. [Al-Jaami’ as-Sagheer (6803)]