Blood leaves the heart through the pulmonic valve, it then moves through the pulmonary arteries which branches to the left and right lungs.
When the deoxygenated blood reaches the lungs, it is then oxygenated and returns to the heart through our pulmonary veins.
Hope this better explains it!