Magnesium is a chemical element and essential electrolyte required by the human body. It plays a role in over 600 cellular reactions and helps muscles and the heart function properly. Good dietary sources of magnesium include pumpkin seeds, almonds, cashews, yogurt and spinach. Both deficiency and overconsumption can negatively impact health, causing issues like fatigue, muscle cramps or abnormal heart rhythms. Maintaining proper magnesium levels through diet is important for overall well-being.