The process responsible for gas exchange in animals is diffusion.
Air, containing oxygen needed for cellular respiration, is inspired in fills the lungs. The high concentration of oxygen in the lung creates a concentration gradient against the poorly oxygenated pulmonary blood, allowing it to diffuse into the blood and be carried around the body.
The carbon dioxide produced by body cells diffuses, down its own concentration gradient, into the relatively carbon dioxide lacking blood. There it is transported through the circulation to the lungs and diffuses out into the alveolar air - there is a higher concentration in the blood than the air - to be removed from the body.