Foods like green leafy vegetables, nuts, seeds, whole grains, and legumes are excellent sources of magnesium.