Follow up a bad deed with a good deed.
Salaam,
The Prophet (peace be upon him) tells us that the performing a good deed wipes away the sin incurred from perpetrating an evil one. Scholars have disagreed whether the “good deed” being referred to here refers specifically to the context of repentance or whether it is general for all good works.
The strongest view is that all good deeds can wipe away evil deeds. Allah says: “And establish prayer at the two ends of the day and at the approach of the night. Indeed, good works do away with evil deeds. That is a reminder for those who take heed.” [ Sûrah Hûd : 114]
A man once came to the Prophet (peace be upon him) and informed him that he had contact with a woman like a husband has with his wife, except that he did not go so far as to fornicate with her. This man had just prayed the Fajr prayer. The Prophet (peace be upon him) said: “Have you prayed with us the Fajr prayer?” When he replied that he had, the Prophet (peace be upon him) recited: “Indeed, good works do away with evil deeds.” [ Sahîh al-Bukhârî (526) and Sahîh Muslim (2763)]
However, a believer should always repent for his sins. Allah says: “And those, who when they commit an indecency or wrong themselves, remember Allah and seek forgiveness for their sins – and who forgives sins except Allah – and then do not knowingly persist in what they have done, for them is forgiveness from their Lord and gardens beneath which rivers flow, wherein they shall abide forever. How great is the reward for those who work righteousness.” [ Sûrah Âl `Imrân : 135]
A believer should follow up his sincere repentance with the performance of good works. This is what Allah wants from us. He says: “Indeed, I am Most Forgiving to whomever repents, believes, and works righteous deeds and then continues upon guidance.” [ Sûrah TâHâ : 82]
Allah also tells us: “Except for those who repent, believe, and work righteous deeds. For those, Allah will change their evil deeds into good deeds, and Allah is Most Forgiving, Most Merciful.” [ Sûrah al-Furqân : 70] This is especially true for major sins. A Muslim must never leave a major sin to go without repentance, for Allah's promise of forgiveness is for those who turn to Him in sincere repentance. The Prophet (peace be upon him) said: “A servant, if he acknowledges his sin and then repents, Allah will forgive him.” [ Sahîh al-Bukhârî (4141) and Sahîh Muslim (2770)]
Do Good People Go To Hell ?
Abdur Raheem Green discusses this issue