Abu Dharr reported: I said, “O Messenger of Allah, instruct me.” The Prophet, peace and blessings be upon him, said, “If you do a bad deed, follow it with a good deed to wipe it out.” I said, “O Messenger of Allah, is it a good deed to declare there is no God but Allah?” The Prophet said, “It is the best of good deeds.”
Source: Musnad Aḥmad 21487
Grade: Sahih (authentic) according to Al-Albani
عَنْ أَبِي ذَرٍّ قَالَ قُلْتُ يَا رَسُولَ اللَّهِ أَوْصِنِي فَقَالَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا عَمِلْتَ سَيِّئَةً فَأَتْبِعْهَا حَسَنَةً تَمْحُهَا قُلْتُ يَا رَسُولَ اللَّهِ أَمِنْ الْحَسَنَاتِ لَا إِلَهَ إِلَّا اللَّهُ قَالَ هِيَ أَفْضَلُ الْحَسَنَاتِ
21487 مسند أحمد بن حنبل
3162 المحدث الألباني خلاصة حكم المحدث صحيح في صحيح الترغيب