The exchange of gases occurs by a process of diffusion(movement of gas molecules from a region of high concentration to low concentration). This process takes place in lungs.
When we breathe in, air reaches to the alveoli(basic unit of lungs or cells of lungs) which are in close vicinity to the tissues. Alveoli are rich in oxygen but tissues are rich in carbon-dioxide, so the gases are exchanged by diffusion along the concentration gradient. Oxygen moves towards the tissues whereas carbon-dioxide moves away from the tissues into the alveoli. This is how exchange of gases occurs in a cell.