The invention relates to biochar prepared by co-pyrolysis of excess sludge and hazelnut shells and a photocatalytic modification method of the biochar. The method comprises the following steps: dryingand crushing the excess sludge and hazelnut shells, proportionally mixing, adding a potassium carbonate solution, soaking, drying, carrying out vacuum pyrolysis, sequentially washing with diluted hydrochloric acid and deionized water, and drying to obtain the biochar. The method comprises the following steps: dissolving zinc chloride in deionized water, adding a corresponding amount of sodium hydroxide under a stirring condition, completely dissolving and adding biochar, placing the prepared solution in a glass bottle, standing at a constant temperature under a closed condition until the reaction is complete, and cooling to room temperature to obtain the nano ZnO composite biochar material. According to the method, the residual sludge and hazelnut shells containing a large amount of organic matters are mixed and pyrolyzed to prepare the biochar, and the activated pore-forming method of potassium carbonate solution soaking is combined, so that the pyrolysis process is easier to occur,compared with crop pyrolysis modes such as direct incineration, pyrolysis and addition of corn straw, the method is simple, and the biochar product which is high in yield, large in specific surface area and good in porosity and has photocatalytic performance is more favorably formed.