Thoughs on Magnesium and Brain Fog

Been suffering brain fog for a while now and my neuro suggested Magnesium supplements. Any thoughts on that? Anyone had good experience with Magnesium?