Magnesium supplements are generally considered safe, but some people may experience gastrointestinal issues, like diarrhea, cramps, and nausea. Supplements may help with constipation, muscle cramping, and preventing or managing conditions including diabetes, osteoporosis, and heart disease.