Magnesium is an essential vitamin for over 300 functions in the human body. 300! It has been estimated that up to 70% of people are magnesium deficient.
GERD (gastro-esophageal reflux disease) heart burn, ulcers or anything involving excessive acid in the stomach is also a frequent problem in today's society. The treatment for choice of many doctors is to prescribe something like Prilosec. These heart burn medications cause a magnesium deficiency. If you were already low, this can really cause some issues. Everything from severe leg cramps, to not being able to convert the food you eat into energy, can be a symptom of this deficiency.
Make sure the magnesium supplement you chose is high quality. There is always a second word behind the magnesium, such as Magnesium Glycinate or Citrate. They should always end in -ate. I recommend THIS to my patients.
Some common foods that can be added to the diets are dark leafy green vegetables and nuts. But, I recommend up to 400mg a day. That would be hard to get through diet alone.