I don't know how to prevent it, sorry. It occurs where your body is in the phase of being paralyzed during sleep and you wake up prematurely which you're not supposed to. I would say it sounds like you have a case of insomnia for some reason if you started having trouble falling asleep after having trouble staying asleep.
Get better sleep habits(as you said) and try to become stress free. Is your life changing a lot in some way? New job or people? Try to relax. I had it before.
Yer it has, I had a very busy winter break so my sleeping patterns wernt regular at all cos i was staying up late alot. As for stress im in my final year of my A-levels so my exams are coming up this year. Now im back at school my sleep patterns are regular but probably not best they could be. I havent had another episode yet.
Thankyou for your advicce :)