is magnesium good for you?

so i have restless leg syndrome , i have heart palpitations , and i have cramps .. on my period. Is magnesium good for all that and what’s a good magnesium tablet or something ?