Out of the hundreds of tasks that magnesium performs in the body, it is also a natural sedative. Thus, deficiency of magnesium can result in sleeping difficulties, constipation, muscle tremors, cramps, anxiety, irritability, and pain. It has also helped people with restless leg syndrome.