The greenhouse effect refers to the process by which certain gases in the Earth's atmosphere trap heat from the sun and prevent it from escaping back into space. These gases, known as greenhouse gases, include carbon dioxide (CO2), methane (CH4), nitrous oxide (N2O), and water vapor.