The contraction and relaxation of your diaphragm controls the movement of your lungs. When the diaphragm contracts, it becomes flatter, the pressure in the chest cavity is reduced and the lungs expand resulting in rushing of air into them. At the same time, the rib muscles contract lifting the ribs upwards and outwards.
When the diaphragm and the ribs relax, the lungs shrink and force the air out (breathing out). Air is breathed in through the mouth and nose.
It passes through the windpipe or trachea. The trachea is divided in to two bronchial tubes that are further divided into a number of smaller tubes called bronchioles. These finally end into air sacs called alveoli, which are surrounded by a network of blood capillaries.
When air reaches these alveoli, the oxygen of the air is absorbed by the blood. Waste carbon dioxide passes from the blood into the alveoli and is breathed out.