At our Biosolids Processing Facility, we receive about 130,000 tons of excrement and turn it into a fertilizer amendment! When you flush the toilet, the waste goes to a water treatment plant. That plant takes the liquids and gives us the solids or sludge. This sludge is dried at high heat with a dryer that is powered by landfill gas. The temperature is high enough to kill harmful pathogens and bacteria. This dried cake then goes into a machine that pelletizes and sizes it so it can be sold as fertilizer amendment.
Check out this video from CDM Smith on the overall process.