Improving college students' health, contentment, and quality of life through physical exercise (PE) is a pressing issue that the government, society, education, and the academic community must urgently consider and resolve. This study aims to determine the relationship between physical education (PE) and students' mental health (MH). This investigation involves the administration of a survey questionnaire to 1,000 college and high school students. The results indicate that the anxiety and depression levels of college students were substantially higher than those of middle school students and that the anxiety and depression levels of boys were higher than those of girls. Moreover, the adjustment efficiency of melancholy and pain is greater among physical education majors than non-majors. PE affects MH by influencing emotion regulation self-efficacy (SE). Additionally, emotional regulation SE influences MH by affecting emotional regulation strategies. Emotional regulation SE and emotion regulation strategies (ERS) mediate the relationship between psychiatric symptoms (PE) and personality traits (MH).