Amidst the rising carbon emissions posing significant challenges for the global environment, there exists an inadequate recognition of the profound implications associated with foreign investment, trade openness, and energy consumption in South Africa. This study investigates the dynamic relationship among foreign investment, trade, energy, and the interactive effect of foreign investment and trade openness on environmental pollution in South Africa using time series data from 1990 to 2020. The results from the Johansen cointegration analysis and vector error correction model confirm a sustained long-term relationship among foreign investment, trade, energy, and CO2 emissions. This suggests that any deviations from CO2 emissions equilibrium would gradually self-adjust autonomously. This study reveals the long-run positive effects of trade openness and energy consumption on environmental pollution, while foreign investment exhibits a persistent negative impact on environmental pollution in the long run. Economic growth reduces CO2 emissions, while population growth and inflation are detrimental to the environment in the long run. The interaction between foreign investment and trade reduces environmental pollution in the short and long run. The Granger causality tests show a two-way causal relationship between population growth and CO2 emissions and a one-way causal connection among other variables, enlightening the linkage among these critical factors. The study offers several policy suggestions including environmentally friendly trade practices, investing in energy efficiency and transition, and promoting sustainable foreign investment in South Africa to achieve long-term economic sustainability while curbing environmental impact.