God says
….if any of you who does bad deeds out of ignorance and thereafter repents and amends (his conduct), He shall be [found] much-forgiving , Most Gracious. - Q.6: 54
…. behold, prayer* restrains [one] from shameful deeds and from all that moral sense ought to reject;…. Q.29: 45
* Prayer offered regularly, concentrating upon the fact of being in the presence of God and understanding what is being said by the servant and his Master, has immense benefits. Here is mentioned one of them, and how important!
Whoever does what is just and right, does so for his own good; and whoever does evil, does so to his own hurt; and in the end unto your Sustainer you all be brought back.-- Q.45: 15
O you who believe! No men shall deride* [other] men: it may well be that those [whom they deride] are better than themselves; and no woman [shall deride other] woman: it may well be that those [whom they deride] are better than themselves. And neither shall you defame one another, nor insult one another by [abusive] nicknames. Bad is the name of lewdness after faith;** and they who [become guilty thereof and] do not repent – such are evil-doers!- Q.49:11
* I.e., to attack with scornful laughter **This applies no less to the one who insults than to that of the insulted (Razi): cf. 6: 8 – “[those] who have not obscured their faith by wrongdoing”.
Prophet said
2. “Two traits do not occur in a believer-- miserliness and bad conduct” --H: Tirmizi. N: Abu Sayeed.
3. “Most disliked by me among you and farthest from me on Resurrection Day will be those who are worst of you in conduct” -- H: Baihaqi. N: Abu Salabh.