This document reviews various techniques for optimizing biogas production and upgrading biogas quality through CO2 removal. It discusses pretreatment of substrates, co-digestion, use of serial digesters, and different methods for biogas upgrading including pressure swing adsorption, membrane separation, and CO2 absorption to purify biogas. The optimization of biogas production and upgrading is important as biogas can be a substitute for conventional fossil fuels but the presence of CO2 and other components can reduce its quality and economic feasibility for certain applications.