Best Tips for a Restful Sleep?

I really need some advice! Normally I sleep like a baby every night. I go to bed around 11 PM and I wake up at 6 AM with no problem. But last night the strangest thing happened. I laid in bed for three hours before I fell asleep!  Even worse, once I did fall asleep it was a very light sleep and I woke up every hour on the hour. So I probably only got three hours of sleep and I was so exhausted today at work. Honestly this sort of thing never happens to me so I was wondering if there are any ideas about what I can do to prevent this from happening in the future?  A girlfriend at work told me if I can’t fall asleep to get up and have a snack but that sounds kind of crazy. Who wants to get up in the middle of the night and cook LOL. I was thinking maybe a more natural remedy might be appropriate. I’ve heard magnesium baths are a great way to relax and get sleepy. Any other ideas for what I can do? I would appreciate your suggestions so much!