Alvioli (singular 'alviolus') are little bags that, when you breath in, expand with the air you breath in. You have millions of them in your lungs.
Surrounding each alviolus there are little blood vessels called cappilaries. These carry de-oxygenated blood (blood with little oxygen in it) from your heart and have very thin walls and gas particles can pass through the walls easily.
In nature things try to equalise each other. For example if there is less water in one half of a tank of water then the water will flow to where there is less to equalise it out.
It is the same here. There is little oxygen in the blood and much more in the air you breathed in. So oxygen passes through the walls of the alviolus and the cappilary into the blood to equalise it. There is also a lot of Carbon Dioxide in the blood that it picked up from the muscles but little in the air you breathed in. So CO2 moves the other way, out of the blood into the alviolus.
By the time you breath out you breath is mostly CO2 and has almost no oxygen in it.
The lungs, I the alviolies.