As trees takes in carbon dioxide and gives out oxygen, it is almost similar to how our lungs work in our respiratory system. As you know, lungs remove carbon dioxide from our body and transports oxygen in order for us to survive. So the tropical rainforests gives out oxygen for our survival needs, which is somewhat similar.
I hope you understand lawl