Carbon dioxide (CO$_2$) is one of the major greenhouse gases responsible for trapping heat in the Earth's atmosphere, leading to the greenhouse effect. Other greenhouse gases include methane (CH$_4$), water vapor (H$_2$O), and nitrous oxide (N$_2$O).
Thus, the correct answer is option (2).