The invention discloses a preparation method of biochar. The preparation method includes the steps that greening garbage is dried and crushed, then the greening garbage is put into a container, a hydrochloric acid solution is added, soaking and stirring are conducted, filtration under reduced pressure is conducted in a microwave reaction kettle, amylase, deionized water, the hydrochloric acid solution and animal dung are added to be evenly stirred, inert gas is introduced into the container, the container is sealed and heated, after the reaction is completed, a product is collected and filtered, filter is dried, bentonite is added into the filter, the filter is added into a reaction container, the inert gas is introduced into the reaction container, the container is sealed, and the reaction container is baked; and a baked product is taken out and placed in a crucible and placed in a muffle furnace to be carbonized, and the biochar is obtained. The biochar is wide in raw material source, low in cost, easy to obtain, abundant in pore structure and higher in stability, the pore structure of the biochar is relatively dense, and various metal ions can be adsorbed.