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.
First of all, we ask Allaah to enlighten your heart and make you steadfast on his religion until you die.
You have to know that since you are blaming yourself for being negligent, this is already a good sign, and this is as a seed of righteousness in you, a seed that you should care for so that it would give fruits of righteousness and piety. We believe that you know more than ourselves about the reasons of change from righteousness to a kind of deviation. Therefore, you should try to discover the reasons and find a solution to every reason.
We provide you with the following general guidelines and we wish that Allaah will make you benefit from them.
1) Repent sincerely to Allaah.
2) Continuously hold yourself to account.
3) Keep company with righteous girls and women and avoid keeping company with dissolute ones.
4) Attend circles of knowledge.
5) Read about the excellence and superiority of righteous men and women.
6) Seek religious knowledge as much as possible.
7) Perform religious obligations and seek getting near to Allaah by performing supererogatory acts of worship, like optional prayers, reciting the Quran, mentioning the legislated mention of Allaah in the mornings and evenings, fasting, etc...
8) Seek a righteous husband if you are not married, and seek the help of some trustworthy female friends of yours or by asking them to talk to their husbands in order to look for a pious person to marry you. If this is not achieved, then we advise you to fast as the Prophet advised us saying: "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].
As regards your unconditional vow to obey Allaah, this is something good and you should fulfil it. If you meant that you cannot stay on the straight path because of this vow, meaning that you could not achieve some benefits by staying on the right path and the like, then this could be because of a hindrance, like committing some sins and the like. Indeed, one of the means of purifying one's own self is to avoid committing sins and endeavour to perform acts of obedience. If there is a deficiency in one of these two things, [i.e. if the balance between the two is not achieved] then the purification of the soul will not be achieved as required.
Finally, it should be noted that you should take it easy and not think that Allaah will punish you in this life by making you fail in your exam because of your negligence in your religion. What is more serious than that is being punished by being prevented from practising religion and faith and then meet your Lord while committing a sin. Allaah says (which means): {O you who have believed, respond to Allaah and to the Messenger [] when he calls you to that which gives you life. And know that Allaah intervenes between a man and his heart and that to Him you will be gathered.}[Quran 8:24]. Besides, you should mention death as much as possible, as this is the best thing that would help you to take the initiative to repent and be steadfast on the right path. It is confirmed that the Prophet said: "Mention death as much as possible." [At-Tirmithi]
For more benefit, please refer to Fataawa: 87255, 84333 and 88026.
Allaah knows best.