Islam does not allow any intimate relation between a man and a woman out of wedlock. Therefore, anyone that has committed such act has to repent and cut off all relations with that opposite gender.
Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: “Any Muslim in this situation has breached the rules of acceptable Islamic behaviour by establishing an illicit relationship with an opposite gender. And if a Muslim cares for his/her faith and honour, he/she should stop communicating with the opposite gender immediately and never do this again.
Therefore, make sincere tawbah (repentance) to Allah and pray to Him from the depths of the heart to cleanse the heart of all illicit thoughts and to help remain chaste. The following du`a’ should be of considerable help; say it consistently on a regular basis and as often as you can:
Allahumma tahhir qalbee wa ahsin farjee (O Allah! Cleanse my heart (of all base thoughts) and help me to remain chaste!).