Allah says in the Qur’an: “Say: ‘O my Servants who have transgressed against their souls! Despair not of the Mercy of Allah: for Allah forgives all sins: for He is Oft-Forgiving, Most Merciful.'” (Az-Zumar: 53) “Allah accepts the repentance of those who do evil in ignorance and repent soon afterwards; to them will Allah turn in mercy: For Allah is full of knowledge and wisdom.” (An-Nisa’: 17)

It is known that Islam strictly prohibits zina (adultery and fornication) and blocks all doors that may lead to it. In this context, the Prophet, peace and blessings be upon him, considered hungry and lustful looks at a person of the opposite sex as “the zina of the eye,” according to his saying, “The eyes also commit zina, and their zina is the lustful look.” (Reported by Al-Bukhari)
as we know, when Islam prohibits something, it closes all the avenues of approach to it. This is achieved by prohibiting every step and every means leading to the haram (unlawful). Accordingly, whatever excites passions, opens ways for illicit sexual relations between a man and a woman, and promotes indecency and obscenity, is haram.

In this regard, Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
“If one had extra martial affairs with a girl or boy and then you repented sincerely for your heinous sin, then you will be forgiven.
Allah says, “Didn’t they know that it is Allah who accepts repentance of His servants and forgives sins?” (At-Tawbah: 104). The Prophet (peace and blessings be upon him) said, “Allah accepts the repentance of a person as long as death has not reached his collar bone (i.e., as long as it is not done in the last pangs of death ).”
Sincere repentance, however, is not simply saying, “Lord, forgive me”, “I ask forgiveness of Allah.” Sincere repentance involves experiencing within oneself a profound sense of guilt for having disobeyed Allah and for the terrible sin one has committed. Secondly, one should totally refrain from approaching that sin as well as from such associations and circumstances that may led him/her to it; thirdly, one must be resolved never to repeat the same in the future, and finally, one must also do whatever he/she can to wipe out the past sins by engaging in good works as much as possible.
Once the above procedures are followed, we can look forward to Allah’s forgiveness for He is certainly All-Merciful and All-Forgiving.
having said this, it is important to point out that if a person has sinned in the past, he/she must continue to be vigilant, and remember that Allah Sees all that we do. The person should try to visualize heaven and hell as if they are in front of them. That is the only way to check one’s carnal desires .”

Having stated the above, it is advised to:

  1. keep on seeking Allah’s forgiveness
  2. Never think that punishment is the Only way for purity; sincere repentance is your way to Allah for gaining His forgiveness and pleasure
  3. do as much as of good deed as good deeds wipe away sins
  4. encircle yourself with righteous and practicing Muslim brothers
  5. cover your fault and never tell anybody about it
  6. keep yourself busy in worship and spiritual acts.
  7. interact with activities of the society in such a way that it keeps you away from thinking about sex.
  8. avoid gatherings and places that bring men and women physically close to each other.
  9. trying to admire natural things such as flowers and beautiful scenery, which do not stimulate one sexually, instead of admiring girls and women.
  10. try to get married as soon as possible to a good Muslim.

make du`aa’ to Allah to guide you to what is best in this world and the world to come.