Atrial fibrillation causes the heart to beat out of rhythm. To get the heart beating normally again, sometimes the heart is 'shocked' into normal rhythm. The idea of shocking the heart may be intimidating, but it's actually a quick and painless procedure.