Introduction. The common ultimate goal of all human beings in the world is to achieve happiness. Middle and high school students in their adolescence are no exception. Many studies have been conducted to promote happiness in various age groups, but some studies have been conducted on the relationship between each variable of hope, grit, mindfulness, and happiness, but no other studies have been conducted to integrate these variables. Therefore, this study aims to confirm whether the agency thinking of hope moderates and mediates the path to happiness through mindfulness and to suggest ways to promote happiness in middle and high school students using these variables. Study participants and methods. The study subjects were 612 middle and high school students living in Chungcheongnam province, South Korea, selected using stratified and purposeful sampling methods. The subjects were 58.9% male and 41.1% female, 49.0% middle school students, and 31.1% high school students. Religion was 69.7% non-religious, 17.9% Christian, 5.7% Buddhist, and 4.4% Catholic. 80.7% lived in small and medium-sized cities, 17.2% in rural areas, and 2.1% in large cities. 84.8% of the families consisted of parents and their children, and 7.5% consisted of a single parent and their children. 46.7% of the respondents said their household income was average, and 35.7% said it was sufficient. 63.5% of the parents were dual- income families, and 36.5% were non-dual-income families. Results. First, the results of the correlation analysis showed that agency thinking had a significant positive correlation with grit, mindfulness, and happiness. In addition, grit, mindfulness, and happiness showed a significant positive correlation. Among the correlation coefficients, agency thinking and mindfulness showed the highest correlation (r=.550, p<.01). Second, grit moderated and mediated the path from agency thinking to mindfulness and happiness. Specifically, agency thinking had a significant positive effect on mindfulness (B=.2647, p<.001), and mindfulness had a significant positive effect on happiness (B=.2985, p<.001). Therefore, mindfulness mediated the relationship between agency thinking and happiness. Next, the interaction term of agency thinking and grit had a significant positive effect on mindfulness (B=.1106, p<.001). Therefore, grit moderated the relationship between agency thinking and mindfulness. Finally, the conditional indirect effect according to grit was significant when grit was M–SD, M, and M+SD, verifying the moderating mediating effect of grit. Practical significance. The results of this study can be used as a model to promote happiness in middle and high school students by utilizing agency thinking, mindfulness, and grit.