All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The major sin and repulsive act you have committed is due to your negligence of the commands of the Prophet who strongly prohibited us from staying alone with the wife of a relative.
The Prophet said: “Beware of entering upon women.” A man from the Ansar said, “O Messenger of Allah, what about the Hamw (male relatives of the wife's husband)?” The Prophet replied: “The Hamw are death itself.” [Al-Bukhari and Muslim]
The male relatives of a wife’s husband are his brothers, cousins, nephews and the like. For her to stay in seclusion with them is as dangerous and serious as death.
Therefore, the Hadeeth means that one should be careful about entering upon a relative's woman, in the same manner as one would be careful about his death. The reason of comparing it with death is that if one commits Zina (adultery or fornication), it destroys his religion, causes his death if they are punished and stoned till death, or the woman will lose her husband and the kin relations will be spoiled through that act.
No doubt, you have committed a great sin but Allah accepts repentance and forgives all sins. Among the conditions of a sincere repentance are: (a) feeling deep sorrow for what has happened, (b) taking a firm decision never to do it again.
The supportive matter for doing so is leaving the bad place and keeping away from Satanic insinuations.
Allah Says (what means): {O you who have believed, do not follow the footsteps of Satan.} [Quran 24: 21]
“Footsteps of Satan” means his ways and paths. So, whoever follows his steps will surely fall into evil and commit sins as mentioned in the verse (which means): {… And whoever follows the footsteps of Satan - indeed, he enjoins immorality and wrongdoing.} [Quran 24: 21]
Being engrossed in doing good helps to support one's repentance from evil, otherwise he may become engaged in evil deeds.
Therefore, dear brother, you should keep away from looking at what is forbidden since gazes lead to Zina, as a poet said that huge flames are always from small sparks.
Moreover, we advise you not to be alone; rather, you should keep company with righteous friends who will help you to remember Allah so as not to forget. Also, you should supplicate Allah to keep you away from all kinds of evil, in addition to doing good deeds as much as possible, especially fasting.
For more benefit on the conditions of sincere repentance, please refer to Fatwa 86527.
Allah knows best.