If one admits its sins such Zina and asks for the punishment to be given while living in the western countries. What can be done How can you purify yourself while getting education in western countries where you are in enormous pressure to carry sins such as Zina?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
It is an obligation on whoever has committed adultery or fornication to repent to Allaah and if he is in a country where the ruler implements the corporal punishment determined by Islamic Law, he has to conceal his sin and not take his matter to the judges so that they would implement on him the punishment for adultery or fornication. The Prophet said: "Whoever happens to commit any of these filthy things, should conceal himself/herself as Allaah did not expose him." [Al-Haakim] So the matter is not as some people think that one cannot be purified from this sin unless he/she takes his/her case to the judge who would implement the corporal punishment determined by Islamic Law on him/her. Likewise, if one is in a country where Islamic corporal punishments are not applied, then he has to conceal his sin.
As regards the means of protecting oneself from adultery or fornication, they are so many, so we are going to mention only a few of them.
1) [In your case] you should leave the non-Muslim country and return to your Muslim country. As you mentioned, it is because of your residence in a western country that you were tempted and indulged in this fornication which a great and major sin. Allaah says (which means): {And do not approach unlawful sexual intercourse. Indeed, it is a Faahishah (i.e. anything that transgresses its limits; a great sin), and an evil way (that leads one to Hell unless Allaah forgives him.}[Quran 17:32]. Had you been in a Muslim country, you would not have been incited and tempted to commit this great and major sin. For more benefit, please refer to Fataawa: 82091, 86405 and 87373 about the ruling on residing and studying in a non-Muslim country.
2) To be patient against one's desires and on refraining from what Allaah has forbidden. If one is patient, he will be successful, and patience is the key to resolving difficulties. Indeed Allaah brings relief after every hardship.
3) To protect one's chastity by marrying a religious woman who will be content with what Allaah has blessed you with and be pleased with your circumstance and material condition. The material condition of a person should not be a hindrance to marriage. Indeed Allaah promised to make rich those who seek to protect their chastity by marrying. Allaah says (which means): {And marry those among you who are single (i.e. a man who has no wife and the woman who has no husband) and (also marry) the Sâlihûn (pious, fit and capable ones) of your (male) slaves and maid-servants (female slaves). If they be poor, Allaah will enrich them out of His Bounty.}[Qur'an 24:32] Ibn Mas'ood said: 'Seek wealth by marrying, as Allaah says (which means): {If they be poor, Allaah will enrich them out of His Bounty.}'.
4) To fast as much as possible as it is a protection from committing this sin. The Prophet said: "O young people! Whoever among you can marry, should marry, because it helps him lower his gaze and guards his modesty (i.e. his private parts from committing illegal sexual intercourse etc.), and whoever is unable to marry, should fast, as fasting helps him control his sexual desire." [Al-Bukhari and Muslim]
5) To avoid places of temptation and places that stimulate one's desires, and be busy in a religious or worldly work or activity so you will not have any spare time.
6) To lower your gaze.
7) To supplicate to Allaah to make a way out for you, and always fear Allaah, as whoever fears Him, Allaah will make a way out to his difficulties.
Finally, we ask Allaah to protect you from every evil thing, facilitate for you lawful means and protect you from all forbidden ways.
Allaah knows best.
You can search for fatwa through many choices