Your doctor may suggest drinking magnesium citrate.
You need about 270mg a day, and look for magnesium citrate, which is easier to absorb than magnesium oxide.