Carbon dioxide is also known as CO2. It is composed of two oxygen atoms bonded to a single carbon atom. At standard temperatures, CO2 is in a gas form. Some people make CO2 for making their vegetable gardens more productive. Plants use CO2 in the photosynthesis process. You can even inject CO2 into water mixed with syrup to make your own soft drinks.
Make a hole in your container lid. Fill your container--water bottle, 2-liter bottle, etc.--halfway full of tap water.
Put in 1 tsp. of sugar and 1 tsp. of activated yeast. Cover the hole of your container and shake it vigorously for a couple of minutes.
Shake your bottle every 6 hours for 48 hours. You will need to get some sleep, so just shake your bottle when you wake up in the morning.
Watch for bubbles after 48 hours. The bubbles you see is the CO2 gas being released into the air. If you are using your CO2 container for gardening, just place the bottle next to your plants and they will absorb the additional CO2 naturally.
Add more sugar and yeast if you do not see bubbles after 48 hours, but always add them in equal amounts and start the process again.
TL;DR (Too Long; Didn't Read)
Make sure you cover the hole while shaking your container. There are beakers and tubes you can hook up to your container to capture the CO2 gas if you have a specific use for the gas that does not involve gardening.
If you add too much yeast and sugar to your container, it can actually explode. So always start with a teaspoon of each ingredient.