Plants use carbon dioxide in a process known as photosynthesis. During photosynthesis, plants give off oxygen as a waste product. Carbon dioxide moves from the air into the leaves of plants through tiny openings in the plant's leaves. Oxygen moves out of the plant leaf through these same openings.
Plants take in carbon dioxide, and turn it into oxygen. Animals breathe in that oxygen and breathe out carbon dioxide. So with out one or the other, there would be an imbalance of oxygen and carbon dioxide and nothing would be able to survive.