There are several approaches to generate energy from waste. The most common would be the generation of biogas from microbial action in anaerobic landfills but this requires the landfill to be filled up and shut down as layers of pipes to collect the gas must be laid then the entire landfill sealed with a layer of clay then soil. Sewage could be more easily biodigested into biogas by how we design the treatment plants or on a small scale by replacing septic tanks with biodigesters.
Another approach is gasification but 51% of the carbon is released as CO2 and any contaminants could also be released.
In both approaches, the main cost is in bringing the wastes to whatever will process them. Biomass has a relatively low energy density to volume so it is costly to move hence either existing collection facilities must be modified or they must be processed where wastes are generated.
Investment in wastes to energy carries the risk of being worthless should oil drop in price below $80 a barrel and as was demonstrated in 1986, the price of oil could easily collapse to $12 a barrel due to political reasons.