You can prevent atrial fibrillation from happening by keeping your heart healthy. Not smoking, eating a healthy and balanced diet and exercising regularly can help your heart stay healthy.