Narrated Ubada Bin As-Samit that Allah’s Messenger (salAllahu alayhi wasalam) said: ‘Whomever wakes up at night and says La ilaha illallahu wahdahu la shrika lahu lahulmulku, wa lahul hamdu, wa huwa ala kulli shai’in qadir. Alhamdu lillahi, wa subhanallahi wa la ilaha illallahu, wallah akbir, wa la hawla wala quwata illa billah (none has the right to be worshipped but Allah (Subhanahu wa Ta’ala) He is the only one who has no partners. His is the kingdom and all the praises are for Allah (Subhanahu wa Ta’ala) All the glories are for Allah (Subhanahu wa Ta’ala) And none has the right to be worshipped but Allah (Subhanahu wa Ta’ala) and Allah (Subhanahu wa Ta’ala) is the most Great and there is neither might nor power except with Allah (Subhanahu wa Ta’ala) and then says, Allahumma ighfir li (O Allah! Forgive me) or invokes Allah (Subhanahu wa Ta’ala), he will be responded to and if he makes ablution and performs Salat (prayer), his Salat (prayer) will be accepted. [Sahih al-Bukhari]
Praise be to Allaah. There is no doubt that what you have done is a kind of zinaa (unlawful sexual activity), although it is not the worst kind, so you must repent sincerely to Allaah, give up this sin, regret what has happened and be determined never to go back to it. Avoid bad friends and bad places, lower your gaze and keep your distance from women to whom you are not related (non-mahram). If you repent to Allaah, He will accept your repentance. You are still a Muslim, but you have committed an act of disobedience towards Allaah by doing this sinful act, so come back to your Lord and seek His forgiveness for what you have done. Do more good deeds to expiate for and cancel out your bad deeds, do those things that will help you to remain chaste, and hasten to marry according to Islam. Finally, we will leave you with a story from which you may learn a valuable lesson: Ibn Mas’ood reported that a man came to the Prophet (peace and blessings of Allaah be upon him) and told him that h...