The weather
Humidity and dew
In a sentence: When the temperature drops to the dew point, water condenses on your optics and the night is over; heaters prevent it.
The essentials
The dew point is the temperature at which the air saturates. The closer the temperature and the dew point get (less than 2–3 °C, or 4–5 °F, apart), the greater the risk. Heater straps around the lens or the tube, and a dew shield, keep the optics a few degrees above it. When you pack up in damp conditions, don’t cap the tubes: leave them uncapped to dry somewhere dry and cap them hours later.
Why the optics fog up
At night the telescope radiates heat to the sky and cools below air temperature. If it reaches the dew point, the vapor condenses on the lens or the corrector plate. It happens sooner on clear, calm, humid nights, which are exactly the ones that look perfect.
How to avoid it
A heater strap around the lens or the tube (and another on the finder or the guide scope) keeps it a few degrees above. A long dew shield delays the problem. A hair dryer is only an emergency fix: it can warp plastics and shift the focus.
Enter the temperature and the humidity: the dew point, the margin you have left and the watts your tube needs.
Dew point calculator