The forecasting of carbon dioxide (CO2) emission trends stands as a pivotal step towards achieving environmental sustainability. As countries grapple with the challenge of curbing escalating CO2 emissions, the significance of accurate forecasting has become increasingly pronounced in recent years. In this study, to unveil the trajectory of CO2 emissions in Pakistan, forecasting was done through advanced artificial intelligence (AI) driven Artificial Neural Network (ANN), Gated Recurrent Unit (GRU), and Long Short-Term Memory (LSTM) models. Rigorous data preprocessing techniques were applied to historical CO2 emissions data for Pakistan comprising of 76 points from year 1946 to 2021. Sequences were formulated to capture temporal dependencies, paving the way for model training and validation. The ANN, GRU, and LSTM models were meticulously designed, each bearing unique attributes for time series forecasting. The obtained results yielded valuable insights, epitomized by model evaluations and predictions. The ANN model did really well with a test MAE of 8.111, a test R² of 0.8614 and a test RMSE of 10.25. The GRU model, characterized by a test MAE of 7.936, a test R² of 0.8355 and a test RMSE of 11.25, proved its worth as well. In contrast, the LSTM model demonstrated excellence with a test MAE of 7.941, a test R² of 0.8586 and a test RMSE of 10.45. A novel ensemble approach, combining these three models, yielded a test MAE of 7.876, a test R2 of 0.869, and a test RMSE of 10.5043. Further, the models were employed to forecast CO2 emissions for Pakistan from the year 2022 to 2030. The insights gained from this study not only enhance our understanding of CO₂ emissions trends in Pakistan but also provide valuable guidance for global efforts to adopt cleaner lifestyles and sustainable choices, fostering a healthier planet for all.