On what one says and does if one commits something forbidden

Riyad as-Salihin (The Meadows of the Righteous)

by Imam Nawawi

369. Chapter: On what one says and does if one commits something forbidden

Allah Almighty says, "If an evil urge from Shaytan eggs you on, seek refuge in Allah," (W41:35; H41:36) and the Almighty says, "As for those who are godfearing, when they are bothered by visitors from Shaytan, remember and immediately see clearly." (7:201) The Almighty says, "Those who, when they act indecently or wrong themselves, remember Allah and ask forgiveness for their bad actions – and who can forgive bad actions except Allah – and do not knowingly persist in what they were doing. Their recompense is forgiveness from their Lord, and Gardens with rivers flowing under them, remaining in them timelessly, forever. How excellent is the reward of those who act!" (3:135-136) The Almighty says, "Turn towards Allah, O believers, every one of you, so that perhaps you will have success." (24:31)

1807. Abu Hurayra reported that the Prophet, may Allah bless him and grant him peace, said, "Anyone who swears and says in his oath, 'By al-Lat and al-'Uzza,' should say, 'There is no god but Allah.' Anyone who says to his companions, 'Come, I will make a wager with you,' should give sadaqa.'" [Agreed upon]