The heart is made up of 4 chambers. There are 2 chambers in the top called the atria (singular = atrium) and 2 chambers in the bottom called ventricles. There is an atrium and a ventricle on each side of the heart, hence giving your 4 chambers. The atria pump blood down to the ventricles, which then pumps blood to the body and lungs.
The heart’s electrical wiring is set up in such a way to allow the chambers of the heart to work effectively and pump blood. Without this electrical wiring, the heart would not pump. Located at the top of the right atrium is a specialized tissue called the sinus (or sinoatrial) node. This serves as the natural pacemaker of the heart. It creates a signal about once every second. The signal spreads across the atria causing these 2 chambers to squeeze blood into the ventricles.
The signal also goes to the atrioventricular (AV) node which is the electrical junction box between the atria and ventricles. From here the signal spreads throughout the ventricles using specialized electrical structures such as Bundle of His, bundle branches, fascicles, and Purkinje system. By this time the blood has flowed in from the atria. Once the electrical signals reach various parts of the ventricles, then the ventricles will pump blood out to the body and lungs. People who have failure of this delicate electrical system and wiring may require a pacemaker to resume normal heart function.