Cardioversion is a procedure used to restore abnormal heart rhythms to normal sinus rhythm. It can be done electrically by delivering a controlled electric shock to the heart through electrodes on the chest, or chemically using antiarrhythmic medications. The goals are to disrupt abnormal electrical circuits in the heart and restore a normal heartbeat. Defibrillation is a similar procedure used to treat life-threatening conditions like ventricular fibrillation and cardiac arrest by stopping chaotic heart rhythms with an electric shock, with the hope that the heart will then resume normal contractions.