In order to study the influence of water content on the failure and deformation characteristics of sandstone, the indoor compression test and numerical simulation of sandstone under different conditions were carried out. The results show that with the increase of water content, the peak strain increases and the peak strength decreases. With the increase of water content, the transverse and longitudinal strains of rock samples gradually increase. This conclusion can provide reference for the safe construction of underground engineering in water-rich areas.