Umar b. Abdul Aziz RA said. ‘Whoever of you does good action then let him praise Allah. Whoever does wrong action, let him seek Allah’s forgiveness and turn in tawbah, because for some people there is no avoiding doing actions which Allah appointed as their destinies and which He decreed for them.’
In another narration from him, ‘Whoever does a wrong action, then let him seek Allah’s forgiveness and turn in tawbah. Then if he repeats [the wrong] then let him seek Allah’s forgiveness and turn in tawbah. Then if he repeats then let him seek Allah’s forgiveness and turn in tawbah, because they are only mistakes marked on men’s necks, and total destruction lies in persistence upon them.’
The meaning of this is that the slave will unavoidably do whatever wrong actions are decreed for him, as the Prophet S said, ‘There is decreed for the son of Adam his portion of adultery, and he will meet that unavoidably.’ [Bukhari]. However. Allah has made a way out for the slave from the wrong actions into which he falls, and he effaces them by turning in tawbah and seeking Allah’s forgiveness. If he does that then he becomes free from the evil of this wrong action, and if he persists in that, he perishes.
Ibn Rajab, Jami al-Ulum wa’l-Hikam