The essence of rock fracture can be broadly categorized into four processes: energy input, energy accumulation, energy dissipation, and energy release. From the perspective of energy consumption, the failure of rock materials must be accompanied by energy dissipation. Dissipated energy serves as the internal driving force behind rock damage and progressive failure. Given that the process of rock loading and deformation involves energy accumulation and dissipation, the rock constitutive model theory is expanded by incorporating energy principles. By introducing the dynamic energy correction coefficient, according to the law of the conservation of energy, the total energy exerted by external loads on rocks is equal to the energy dissipated through the dynamic energy inside the rocks. A new type of energy constitutive model is established through the functional principle and momentum principle. To validate the model’s accuracy, a triaxial compression test was conducted on sandstone to examine the stress–strain behavior of the rock during the failure process. A sensitivity analysis of the parameters introduced into the model was conducted by comparing the model results, which helped to clarify the innate laws of significance of these parameters. The results indicated that the energy model more accurately captures the non-linear mechanical behavior of sandstone under high-stress loading conditions. The model curve fits the test data to a high degree. The fitting curve was basically consistent with the changing trend of the test curve, and the correlation coefficients were all above 0.90. Compared with other models, the model based on the energy principle not only accurately reflects the rock’s stress–strain curve, but also reflects the energy change law of rock. This has reference value for the safety analysis of rock mass engineering under loading conditions and aids in the development of anchoring and support schemes. The research results can fill in the blanks that exist in the energy method in terms of rock deformation and failure and provide a theoretical basis for deep rock engineering. Moreover, this research can further improve and extend the rock mechanics research system based on energy.