Surah Az-Zumar 39:35
لِيُكَفِّرَ ٱللَّهُ عَنْهُمْ أَسْوَأَ ٱلَّذِى عَمِلُوا۟ وَيَجْزِيَهُمْ أَجْرَهُم بِأَحْسَنِ ٱلَّذِى كَانُوا۟ يَعْمَلُونَ
That Allāh may remove from them the worst of what they did and reward them their due for the best of what they used to do.
Translation: Saheeh International
Tafsir
so that God may absolve them of the worst of what they did and pay them their reward by the best of what they used to do aswa’a and ahsana mean simply al-sayyi’ ‘bad’ and al-hasan ‘good’.
Excerpt from Tafsir al-Jalalayn, commentary on 39:35, via Quran.com. The reader has the full commentary and 9 more tafsirs.