Myocardial energy metabolism (MEM) is an important factor of myocardial injury. Trimetazidine (TMZ) provides protection against myocardial ischemia/reperfusion injury. The current study set out to evaluate the effect and mechanism of TMZ on MEM disorder induced by myocardial infarction (MI). Firstly, a MI mouse model was established by coronary artery ligation, which was then treated with different concentrations of TMZ (5, 10, and 20 mg kg–1 day–1). The results suggested that TMZ reduced the heart/weight ratio in a concentration-dependent manner. TMZ also reduced the levels of Bax and cleaved caspase-3 and promoted Bcl-2 expression. In addition, TMZ augmented adenosine triphosphate (ATP) production and superoxide dismutase (SOD) activity induced by MI and decreased the levels of lipid peroxide (LPO), free fatty acids (FFA), and nitric oxide (NO) in a concentration-dependent manner (all P < 0.05). Furthermore, an H2O2-induced cell injury model was established and treated with different concentrations of TMZ (1, 5, and 10 μM). The results showed that SIRT1 overexpression promoted ATP production and reactive oxygen species (ROS) activity and reduced the levels of LPO, FFA, and NO in H9C2 cardiomyocytes treated with H2O2 and TMZ. Silencing SIRT1 suppressed ATP production and ROS activity and increased the levels of LPO, FFA, and NO (all P < 0.05). TMZ activated the SIRT1–AMPK pathway by increasing SIRT1 expression and AMPK phosphorylation. In conclusion, TMZ inhibited MI-induced myocardial apoptosis and MEM disorder by activating the SIRT1–AMPK pathway.