Cardioversion is a procedure used to return an abnormal heartbeat to a normal rhythm . This procedure is used when the heart is beating very fast or irregular. This is called an arrhythmia. Arrhythmias can cause problems such as fainting, stroke, heart attack, and even sudden cardiac death.