2500mg sodium, 3000mg potassium, 400mg magnesium are optimal.
You can do fine on half magnesium and half potassium. More or less sodium depending on your thirst / sweating.
If you get thirsty and can’t seem to quench it, you probably need more sodium.
Magnesium you want to avoid magnesium oxide because it has 4% bioavailability. Magnesium Citrate is easy to find but it’s a laxative so be careful.
Idk about pill forms, i make Snake Juice and take a 200mg magnesium tablet.