In order to investigate the shear mechanics of deep rock masses under high ground stress, a semi-empirical and semi-theoretical bonded contact model was implanted into discrete element software to simulate the direct shear test of sandstone, through which the macroscopic and microscopic characteristics of sandstone were analyzed in detail. The simulation results show that the direct shear test of sandstone can be divided into three stages: the linear shear stage, the stress decreasing stage and the residual strength stage. During the shearing process, the external force is mainly converted into particle frictional energy, so energy conservation always exists in the system. The number of bond failures increases with the increasing of shear strain. The number of bond failures in the tensile zone is greater than that in the compressive zone. And the failure modes of bond are dominated by bending failure mode. Cracks start to generate from both ends of the shear plane, cracks of tensile zone first occur in the middle of the shear plane and then propagate to the ends, upper and lower side, whereas the cracks of compressive zone propagate from both ends of the shear plane to the middle. Then, the cracks of tensile and compressive zone connect and penetrate through the entire shear plane, form a distribution domain with an ellipsoid-shaped section. The results of direct shear numerical tests of sandstone are consistent with those of the laboratory test.