There are lots of websites out there, here is one: WHY We’re All Deficient In Magnesium: Top Signs And What You Can Do
Interesting list of foods that are good sources of magnesium - green veg - particularly leafy greens, red/orange fruits and veg, pulses and whole grains. The basics that always seem to crop up as good sources for everything from dietary fibre to antioxidants.
I personally don't take any supplements, but if they work for you and you look or feel better for them, all power to you. Couple that with a generally healthy diet, plot grown produce to support this and the exercise involved in growing it. That sounds like a good mix to me.
I think we all know someone (usually pretty evangelical about it all and a self appointed member of the food police) who gulps down handfuls of pricy pills or vile concoctions, but otherwise has a so-so diet and lifestyle. As with most things, a common sense approach works best