The process of roadway surrounding rock deformation and instability is always accompanied by energy changes, and the energy transformation of surrounding rock directly drives its deformation and failure. In order to realize the stability control of mining roadway, the distribution of elastic strain energy and plastic strain energy of surrounding rock was analyzed by using FLAC3D numerical simulation software on the basis of the energy transformation law of sandstone under different confining pressures revealed by indoor triaxial compression test. Based on this, combined with the energy transformation, the principle of roadway surrounding rock stability control technology is proposed. One is to reduce the elastic strain energy of surrounding rock, that is, by increasing the extension of support body, part of the roadway energy is transferred to the support body, so as to improve the energy release of surrounding rock, or by optimizing the layout of roadway to reduce the energy accumulation of surrounding rock. The second is to increase the plastic strain energy of surrounding rock, that is, to increase the energy dissipation of surrounding rock by setting weak structure. The above research results are applied to the surrounding rock control of the right second transport roadway in the 91st coal of Xinjian coal mine. After the optimization of support measures, the roadway surface displacement and its increase rate decreased significantly, roof subsidence decreased from 247 mm to 62 mm, floor heave decreased from 120 mm to 26 mm, and the right rib shrinkage decreased from 292 mm to 94 mm, that is, the floor heave control effect was particularly obvious. The deformation of surrounding rock gradually stabilized after 45 days.