You are very likely to be magnesium deficient. Taking a magnesium supplement a few times a day, every day, will help you greatly.
There are a few types. The best type imo for your case would be Magnesium Citrate, or Magnesium Malate or Magnesium Chloride or cylcle all or any of these.