Unfortunately in our society youth are constantly bombarded by immorality and corruption and it has become very difficult for those who want to maintain an ethical-religious standard of life to keep up with their values. However Allah is great and He guides whom He wills, therefore put your trust in Him and never despair of His mercy. You may also look at the following factors that may protect you insh'Allah from misguidance and unwishful thoughts:
1) Keep yourself busy with a specific devotional program, pray on time, do not forget supererogatory acts and focus on your attitude, especially for Salat al-Fajr. Try to pay attention to Tahajjud and Salat al-Layl asking for help and forgiveness every night with great hope. During the day recite adhkar regularly that reminds you of Him, and seek refuge in Allah from Shaytan, the cursed one. In the morning commit yourself not to sin, along the day be watchful of yourself, and in the night valuate your own deeds before sleeping.
2) Attend good company and pious relatives and friends who remind you of Allah, His beauty and the purpose of His creation. Spend good time with them and try to imitate them in goodness and piety. They should have a good influence on you and perhaps you may have a good influence on them. Attend Islamic lectures and implement what you learn there, and ask advice from the upright and God-fearing scholars.
3) Start to seriously consider to get married so that an healthy conjugal life may keep yourself far from evil and indecency. The holy Qur'an says that Allah created husband and wife so that they may live with each other in love and compassion (31:21) and our noble Prophet have said: "When a man marries, he has protected half of his religion". If marriage is not possible for the time being, start to work for it, by trying to improve your financial status and by starting to look for the right person for your future marriage insh'Allah.
With prayers for your success.