A procedure used to restore a normal heart rhythm in people with certain types of abnormal heartbeats (arrhythmias). This may be done with medication or a controlled electrical shock.