It is said that to err is human and none is infallible except the Prophets (peace and blessings of Allah be upon them). The Messenger of Allah (peace be upon him) said, “All children of Adam are prone to sin, and the best of those who sin are those who repent.” (Sunan al-Tirmidhi). What counts is that if a person does a misdeed, he should hasten to declare repentance to Allah from it. Allah rightfully acknowledges this and therefore He made the door of penitence wide open till the Day of Resurrection. It is religiously taken for granted that if a person sincerely repents to Allah from a sin, Allah will forgive him as stated by the Hadiths of the Prophet (peace be upon him).
The Prophet said, “Islam wipes away whatever (sins) came before it, and repentance wipes away whatever (sins) came before it.” (Narrated by Ahmad) Moreover, the Prophet (peace be upon him) said, “Whoever repents from sin is like one who did not commit sin.” (Related by Ibn Majah) In his book Al-Adhkar, Imam An-Nawawi elaborates on how to show penitence of sins saying: “Everyone who commits a sin should hasten to repent from it. Repentance from a sin involving violation of the rights of Allah requires three conditions: (i) giving up the sin immediately, (ii) regretting doing it and (iii) resolving not to go back to it.
If it involves violation of the rights of other people, these three conditions are also required, in addition to (iv) restoring to people what is due to them and settling the matter, or to ask them for forgiveness and find a way to relieve themselves of the burden of the sin.”
Sheikh Al-Islam Ibn Taimiyah said: “Whoever wrongs a person by slandering him, backbiting about him or insulting him, then repents, Allah will accept his repentance, but if the one who was wronged finds out about that, he has the right to settle the score. But if he slanders him or backbites about him and the person did not hear of that, then there are two views according to the scholars, both of which were narrated from Ahmad, the more correct of which is that he should not tell him that he spoke against him in his absence. It was said that he should rather speak well of him in his absence just as he spoke badly of him in his absence. Al-Hasan Al-Basri said: ‘The expiation for gossip is to pray for forgiveness for the person about whom you gossiped.”