Sotalol is a medication classified as a beta-blocker, primarily used to treat certain types of cardiac arrhythmias, including atrial fibrillation and ventricular tachycardia. It helps to stabilize heart rhythms by blocking the effects of adrenaline on the heart, which reduces heart rate and workload, making it crucial in managing both arrhythmias and heart failure.