I have been diagnosed as having paroxysmal atrial fibrillation - rare episodes that defy monitoring. A WebMD article that I can’t find now said that rare episodes are usually the first way Afib appears in aging folks but, unfortunately, the Afib episodes then typically become more and more frequent. Magnesium levels have not once come up in discussions of how to improve my situation. Avoiding alcohol, hydration, adequate sleep, avoiding anxiety, potassium levels, TSH levels, weight mgmt (no problema there), exercise, etc., have all been discussed. I’ve only had two really noticeable episodes in two years. The latter one caused my electronic heart rate to go over 160 bpm (as high as 258 at one point) but caused my blood pressure to drop dramatically to 60/40 with a BPM-recorded heart rate around 70 - indicating most of the electronic beats were ineffectual fluttering. My cardiologist said on the basis of the 2-hr duration and severity of that episode alone and my age, I should be on a strong direct anti-coagulant. On the basis of the CHA2DS2–VASc score - Wikipedia, I should be, too. I have had a number of blood tests for electrolyte balance, etc., and I score within an acceptable range for all of those. I’m now taking Eliquis 2x daily.
So, a principal risk of Afib is throwing a clot to the brain. Do worry about electrolyte levels, but finding out whether you should be on a modern anti-coagulant might be the most helpful.
The most impressive part of the Wikipedia article that I cite is the annual stroke risk based on your CHA2DS2-VASc score.
My primary care physician wanted me to start taking a beta-blocker, but I didn’t want to possibly reduce my heart’s ability to respond to exertion. My cardiologist and my PCP were OK with me just carrying tablets of metoprolol around. The PCP warned that in an emergency, the drug might not take effect for 30 min. The cardiologist advised if needed to chew a tablet to speed the blocking reaction, contrary to normal usage instructions: “Do not chew!”
YMMV. Follow your doctor’s advice.