Cardioversion is a procedure to restore the heart’s normal rhythm. You may have the procedure in a hospital or surgery center. It’s often done on an outpatient (same day) basis. During the procedure, you’ll be given medication to keep you free from pain. Then the doctor gives you a brief electric shock. This helps your heartbeat become normal again. In most cases, you can go home the same day as the procedure.