CO2 (carbon dioxide) does not stop algae from growing.
CO2 is an acidic gas that drops the pH of water. Plants (including algae, which is a simple plant) use the carbon in CO2 and release oxygen. However, they only do this when there is sufficient light.
There is plenty of CO2 in the atmosphere that gets into the tank, and it is produced by the fish and various bacteria in the filter, gravel and on ornaments in the aquarium.
Unless you have a heavily planted tank that is getting lots of bright light and nutrients, there is no need to add CO2 to an aquarium.