My advice is simple! Don't let yourself stay up till 3am. Create a nightly routine. Get into bed at 10, 11 at the latest, and if you can't fall asleep, read a book until you feel tired. At least you are in bed.