The sun shines on the sand, making it warm and cozy during the day. That's why the desert feels really hot when the sun is up! But when the sun goes down and there is no light, the sand cools off very fast. So, the desert gets cold at night.
This is because sand holds heat during the day but can't keep it when the sun is gone. That’s why deserts are very hot in the daytime and cold when it’s nighttime.