Hamsters stay warm in winter by creating nests out of bedding material such as paper, hay, or cotton. These nests provide insulation and help trap their body heat to keep them warm. Additionally, they may also burrow deeper into their bedding or substrate to find warmer areas within their enclosure. It's important to ensure that their living environment is kept at a stable temperature to prevent them from getting too cold.