Sodium hydroxide is an alkaline solid substance. It reacts with acids to form salts and water. In this case, it is known that carbon dioxide, CO₂, is an acidic gas. Therefore, the reaction gives a salt that results in carbon dioxide being absorbed by the sodium hydroxide.
Heated copper is an excellent removal of oxygen. This is because monovalent copper, Cu, has a deep binding affinity for oxygen. Hence the the oxygen trapped by the atom.