Biogas is produced by using domestic waste through a process called anaerobic digestion. In this process, organic waste such as food scraps, yard waste, and sewage sludge is placed in a sealed container called a digester. Bacteria break down the organic matter in the absence of oxygen, producing biogas as a byproduct. The biogas is primarily composed of methane and carbon dioxide, which can be used as a renewable energy source for cooking, heating, and electricity generation.