Because snakes are unable to regulate their own body temperature, their habitat needs to have a heated area as well as a cooler area where they can hide and sleep. You can achieve this with an under-tank heating pad (recommended) or an overhead heat lamp.
which snakes prefer belly heat. Not every snake needs heat raining down from above some just want warmth coming up through the floor. Ground-dwellers, especially, depend on belly heat to digest food and regulate their body temperature properly.

Boa Constrictor Temperature Needs. Identifying Snake Species By Scales.What temperature is too cold for snakes. Learn more about habitats and temperatures for snakes.

Keep in mind that because corn snakes are cold-blooded, their habitats need a temperature gradient. They need separate warm and cool areas so they can regulate their body temperature. Additionally, they need a basking areapreferably with a UV lightinside of the warm area.

Artical snake temps. Not all snakes are made the same and they all have special needs including diet, substrate, humidity and especially ambient temperatures. Some pet snakes even have a need for diurnal and seasonal temperature drops to mimic their wild habitats.
Corn snakes need an environment that includes a temperature gradient, with one side of the enclosure warmer (around 88-92F) and the other cooler (75-80F). This setup allows your snake to regulate its body heat naturally.