The Messenger of Allah (sal Allahu alaihi wa sallam) said: “Fear Allah wherever you may be, trail a bad deed with a good deed and it will wipe it out, and treat the people with good character.”
[at-Tirmidhi stated as Hadith Hasan]
His statement “Fear Allah” is a command to have Taqwa and it is to be protected from the punishment of Allah by enacting His commands and abstaining from His prohibitions. This is the best definition that has been stated concerning it.
“Fear Allah wherever you may be” in any place that you are. So do not be like those who fear Allah in a place where the people see them and then not fear Him in a place where no one sees them. Allah, The Exalted, sees you wherever you may be, so fear Him wherever you may be.
“Trail a bad deed with a good deed and it will wipe it out” meaning perform a good deed following a bad deed. So if you commit a sin, then trail it with a good deed. And from that – trailing a bad deed with a good deed – is repenting to Allah from the sin because repentance is a good deed.
His statement, “It will wipe it out” meaning that when a good deed follows a bad deed it wipes out the bad deed. His statement, The Exalted, confirms this (interpretation of the meaning): “Verily, the good deeds remove the bad deeds.” [Hud 11:114]
And from the Benefits of this hadith:
1. The aspiration of the Prophet (sal Allahu alaihi wa sallam) for his nation by guiding them to excellence and righteousness.
2. The obligation of fearing Allah in open and secret due to his statement (sal Allahu alaihi wa sallam) “Fear Allah wherever you may be”
3. The implication (from the hadith) that when a sin is trailed with a good deed it wipes it out and eliminates it entirely. This is general regarding every good deed and sin when the good deed is repentance since repentance abolishes what came before it. As for if the good deed is not repentance; it is when a person commits a sin and then does a righteous action. This is weighed out. If the righteous action outweighs the evil action then it no longer has an effect as He, The Exalted, stated (interpretation of the meaning): “And We shall set up scales of justice on the Day of Resurrection. No one will be dealt with unjustly in anything. And if there were the weight of a mustard seed, We will bring it forth. And We are Sufficient to take account.” [al-Anbiya 21:47]
4. He then said, “And treat people with good character” Interact with them in good character in statement and action, for surely, that is excellent. This affair either is an obligation or highly recommended.
5. The legislation of interacting with the people in good character. The Prophet (sal Allahu alaihi wa sallam) left the mode and manner of this interaction unrestricted. It differs according to the condition of the people. It may be good towards one person and not good towards another. The intellectual person knows and determines this.
And Allah Knows Best!