This study compared and analyzed the mediating effect of depression and the moderating effect of self-esteem on the effects of childhood depression and anxiety on suicidal thoughts in elementary, middle, and high school students according to developmental stage. Unlike existing studies that individually examined the development of elementary, middle, and high school students, this study aimed to suggest intervention measures to prevent suicidal thoughts in childhood by comparing the development stages of elementary, middle, and high school students. The data for this study are data from the 10th (2015), 13th (2018), and 16th (2021) Children's Supplementary Survey of the Korea Welfare Panel, which includes elementary school students in the 10th round, middle school students in the 13th round, and high school students in the 16th round. A total of 1,174 people were used for analysis. The research model was analyzed using the SPSS program and PROCESS macro. Looking at the results of the analysis, first, as a result of confirming the mediating effect of feelings of withdrawal in the relationship between depression and anxiety in childhood and suicidal thoughts in adolescence according to developmental stage, it was confirmed that there was a partial mediating effect in middle school and high school. Second, in the relationship between depression and anxiety in childhood, feelings of withdrawal, and suicidal thoughts in adolescence according to developmental stage, the mediated moderating effect of self-esteem was confirmed in middle school and high school students, but it was confirmed that there was no moderating effect of self-esteem in elementary school students. The above research results were discussed based on previous research, and based on these results, an effective intervention plan was proposed to reduce suicidal thoughts in adolescence.