Which of the following describes the main function of the respiratory system?