RELATED: If You Take This Popular Supplement, Your Heart May Be at Risk, Study Says. If you suffer from irritable bowel syndrome (IBS) or constipation, magnesium may be just what you need. According to Healthline, IBS is thought to be caused by issues between how the brain and the intestine communicate. The condition can manifest in a handful of ways: IBS-C results in constipation, IBS-D results in diarrhea, and IBS-M vacillates between constipation and diarrhea, sometimes on the same day. While magnesium is great for IBS-C, it can exacerbate symptoms of IBS-D and should be avoided by those patients unless your doctor says otherwise. “IBS impacts your gut’s ability to absorb magnesium, and low magnesium also worsens IBS symptoms,” says naturopathic physician Tricia Pingel, NMD. “The lack of magnesium results in constipation, bloating, restless legs, headaches, loss of appetite, and more.” Increasing your magnesium can help alleviate some of these symptoms of IBS. Chris Airey, MD, medical director at Optimale, says that because magnesium relaxes some of the gut muscles, it helps to ease constipation and abdominal cramping while also reducing anxiety. “It also draws water into the intestines, which softens stools and makes them easier to pass,” he adds. RELATED: Stop Using This Supplement Immediately, FDA Warns. One of the key benefits of magnesium that makes it a good aid for IBS symptoms is that it helps muscle function. “Magnesium can be especially helpful because it is an element that is essential to muscle function,” says physician and vitamin expert Arielle Levitan, MD. “It regulates various muscle cells throughout the body and allows them to contract properly, including the muscles of the gastrointestinal tract. Thus, taking a proper dose of magnesium can be helpful in regulating one’s GI tract.“ae0fcc31ae342fd3a1346ebb1f342fcb If you don’t want to take supplements but still want to cram extra magnesium into your diet, there are plenty of magnesium-rich foods you can add to your day-to-day meals. Pingel says nuts, seeds, vegan dark chocolate, spinach, black beans, avocados, oatmeal, bananas, and wild-caught salmon, are packed with magnesium. Additionally, Airey says potatoes, leafy greens, broccoli, tofu, and legumes are also great sources. Pingel notes that while you can get a sufficient amount of magnesium from your diet, most people don’t. But while you could be deficient in magnesium, you can also overdo it. “If you decide to take magnesium supplements, you will need to be careful about your daily intake of magnesium, as taking too much magnesium can cause side effects such as nausea and mild diarrhea,” Airey warns. RELATED: For more up-to-date information, sign up for our daily newsletter. Magnesium isn’t the only thing you should do to help remedy your IBS or constipation. Pingel suggests adjusting your diet to have more whole foods, anti-inflammatory foods, and a ton of water. Since IBS is commonly linked to stress, Pingel said it’s also beneficial to “engage in stress-reducing exercises such as walking in nature, yoga, or pilates,” and to incorporate “stress-reducing mind-body techniques such as meditation and deep breathing exercises.” If you’re looking for other supplements to add to your arsenal, Pingel recommends turmeric, slippery elm, digestive enzymes, and probiotics. RELATED: If You’re Overdoing This Supplement, Your Heart Is at Risk, Doctors Say.