Cacti and some other plants can do something called CAM photosynthesis, where they can open their stomata at night and capture carbon dioxide, chemically storing it, and then use this carbon dioxide the next day when the sun is shining and have their stomata closed, allowing them to avoid having to open their stomata in the heat of the day.