Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:47:2

And those who believe and do righteous deeds and believe in what has been sent down upon Muhammad - and it is the truth from their Lord - He will remove from them their misdeeds and amend their condition.  

But those who believe, namely, the Helpers (al-Ansār) and others ˹like them˺, and perform righteous deeds and believe in what has been revealed to Muhammad, namely, the Qur’ān — and it is the truth from their Lord — He will absolve them of, He will forgive them, their misdeeds and rightly dispose their mind, their state, so that they do not disobey Him.
القرآن:٤٧:٢

وَالَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ وَآمَنُوا بِمَا نُزِّلَ عَلَىٰ مُحَمَّدٍ وَهُوَ الْحَقُّ مِنْ رَبِّهِمْ ۙ كَفَّرَ عَنْهُمْ سَيِّئَاتِهِمْ وَأَصْلَحَ بَالَهُمْ  

{والذين آمنوا} أي الأنصار وغيرهم {وعملوا الصالحات وآمنوا بما نُزِّل على محمد} أي القرآن {وهو الحق من ربهم كفَّر عنهم} غفر لهم {سيئاتهم وأصلح بالهم} حالهم فلا يعصونه.