Over 300 different enzymes within your cells need magnesium to work, including every enzyme that uses or synthesizes ATP (the basic energy molecule in a cell) and including enzymes that synthesize DNA and RNA. Vegetables rich in magnesium include all green vegetables, carrots, squash, sweet potatoes and especially dark green leafy vegetables like spinach and kale.