Breathing involves the use of a muscle known as the diaphragm. It separates the chest cavity from the abdomen in organisms like humans and other mammals.
During inhalation, the diaphragm contracts which expands the chest cavity. This increase in the volume of the chest cavity causes a suction of air in, as the air moves from an area of higher pressure (outside the body) to an area of lower pressure (inside the expanded chest cavity).
During exhalation, the diaphragm relaxes, causing the chest cavity to decrease in size. Now, there is higher pressure inside the chest cavity. The now CO2 enriched air is exhaled.
The lungs contain tiny air sacs known as alveoli in direct contact with blood capillaries. Oxygen from the air we inhale diffuses from the alveoli into the bloodstream and carbon dioxide diffuses from the bloodstream to the alveoli to be exhaled.
There are also intercostal muscles which are muscles between the ribs that assist in breathing by changing the size of the chest cavity. Like the diaphragm, the intercostals contract during inhalation and relax for exhalation.