At the start of each heartbeat, blood returning from the body and the lungs fills the heart's two upper chambers. The mitral and tricuspid valves are located at the bottom of these chambers. As the blood builds up in the upper chambers, these valves open to allow blood to flow into the lower chambers of your heart.
After a brief delay, as the lower chambers begin to contract, the mitral and tricuspid valves shut tightly. This stops blood from flowing backward.
As the lower chambers contract, they pump blood through the pulmonary and aortic valves. The pulmonary valve opens to allow blood to flow from the right lower chamber into the pulmonary artery. This artery carries blood to the lungs to get oxygen.
At the same time, the aortic valve opens to allow blood to flow from the left lower chamber into the aorta. This aorta carries oxygen-rich blood to the body. As the contraction ends, the pulmonary and aortic valves shut tightly. This stops blood from flowing backward into the lower chambers.
This answer from the National Heart, Lung and Blood Institute has been reviewed and/or edited by Dr. William D. Knopf.