Peace be upon you. It is stated in the Quran: 'Indeed, good deeds erase bad deeds.' Since Allah knows that humans are prone to error and may be led astray by their own misfortunes or the whispers of the accursed devil, He encourages them to strive against their desires and to avoid sins as much as possible. However, if one does sin, Allah has opened the door of repentance and the erasure of sins. One of the ways to overcome the effects of sins is to be diligent in performing good deeds, adhering to obligatory acts, engaging in recommended actions, and helping others, as these can erase bad deeds, as mentioned in the blessed verse. Yes, one should not merely perform good deeds while committing sins without repentance, which requires genuine remorse and a firm intention not to return to the sin, as this is essential. It is akin to pouring clean water into a dirty vessel without cleaning it first. May you be successful in all that is good.