I've been trying out herbal cures and found out if you take magnesium each night as you go to bed it helps you sleep better and it also stops headaches from happening. Since I started this I haven't had a single headache or migraine. Now you have to use some common sense also and make sure you are drinking plenty of fluids. Getting dehydrated just invites headaches and other things. So make sure you drink plenty of water and fluids throughout the day and take your magnesium each night and see if your headaches go away.