Describe the management and considerations for treating hypokalemia, especially in patients with arrhythmias, and explain the relationship between hypokalemia and hypomagnesemia.