Despite the importance of understanding the impact of economic globalization on CO2 emissions through renewable and non-renewable energy consumption, previous studies have yielded contradictory results. This study addresses this gap by examining the relationship between trade openness, foreign direct investment, renewable energy consumption, non-renewable energy consumption, and CO2 emissions in China using wavelet analysis. The methodology allows for simultaneous evaluation of the commonality between variables in both time and frequency domains. The results reveal that the causality between variables varies with frequency, with notable reversals in lead-lag relationships. Economic globalization affects CO2 emissions differently through renewable and non-renewable energy consumption, with distinct short-term and long-term dynamics. The findings highlight the need for credible energy transition programs, increased renewable energy utilization, and strengthened global cooperation to balance economic globalization and environmental quality in China. Future research could explore heterogeneity among provinces, nonlinear and asymmetric effects, and expand the scope to other developing economies.