A method and a system for processing waste material to form a biogas and/or ethanol are disclosed herein. The method comprises subjecting waste material to separation according to specific gravity, to thereby obtain a fraction which is a separated lignocellulose; and processing the separated lignocellulose to obtain the biogas and/or ethanol. The system comprises at least one separator configured for separating materials in waste material according to specific gravity to obtain a first fraction comprising a low density material and a second fraction comprising a high-density material; and a bioreactor or bioreactor system configured for processing the separated lignocellulose to thereby obtain the biogas and/or ethanol. The separator contains an aqueous liquid selected such that a portion of the waste material sinks and another portion does not sink upon contact with the aqueous liquid.