Lactate is a crucial intermediary, facilitating communication between myocardial energy metabolism and microenvironmental regulation. The present study aimed to investigate the relationship between lactate-related genes (LRGs) and myocardial infarction (MI). A total of 23 LRGs exhibited differential expression between individuals with MI and healthy controls. Lasso regression analysis and validation with the GSE61144 dataset identified three hub genes: COX20, AGK, and PDHX. Single-gene GSEA of these genes revealed strong enrichment in pathways related to amino acid metabolism, cell cycle, and immune functions. Quantitative reverse transcription-polymerase chain reaction (qRT-PCR) was utilized to validate the expression levels of the hub genes. Immune infiltration analysis revealed differences in CD4+ T and CD8+ T cells between the MI and control groups. Additionally, 67 candidate drugs targeting the three hub LRGs were identified, and a ceRNA network was constructed to explore the intricate interactions among these genes. These findings enhance the understanding of MI and have potential therapeutic implications.