Objective. To study the possible mechanism of ghrelin in heart failure and how it works. Method. In vitro results demonstrated that ghrelin alleviates cardiac function and reduces myocardial fibrosis in rats with heart failure. Moreover, ghrelin intervention increased PTEN expression level and reduced ERK, c-jun, and c-Fos expression level; in vivo experiments demonstrated that ghrelin intervention reduces mast memory expression and increases cardiomyocyte surface area, PTEN expression level, ERK, c-jun, c-Fos expression level, and cell surface area, while ERK blockade suppresses mast gene expression and reduces cell surface area. Results. In vitro experimental results prove that we have successfully constructed a rat model related to heart failure, and ghrelin can alleviate the heart function of heart failure rats and reduce myocardial fibrosis. In addition, ghrelin is closely related to the decrease of the expression levels of ERK, c-jun, and c-Fos, but it can also increase the expression of PTEN in the rat model; in vivo experiments proved that we successfully constructed an in vitro cardiac hypertrophy model, and the intervention of ghrelin would reduce the expression of hypertrophic memory and increase the surface area of cardiomyocytes, increase the expression level of PTEN, and reduce the expression levels of ERK, c-jun, and c-Fos, while the blockade of PTEN will increase the expression of hypertrophy genes and increase the cell surface area, while the blockade of ERK will increase the expression of hypertrophic genes, which in turn will make the cell surface area reducing. Conclusion. Ghrelin inhibits the phosphorylation and nuclear entry of ERK by activating PTEN, thereby controlling the transcription of hypertrophic genes, improving myocardial hypertrophy, and enhancing cardiac function.