What are we talking about? A thermos, of course! And it must be magic, right? After all, how can it both keep hot things hot and cold things cold? Would you believe it's actually all science? It's true!
The courtroom if you fill it with hot soup in the morning, you'll be able to eat hot soup at lunchtime. Likewise, if you fill it with a cool drink, your drink will still be cool several hours later.
The scientific secret to a thermos is a vacuum. We're talking about the kind of vacuum that simply means the absence of air.
A thermos is a bottle with a double-walled container inside of it. The air between the two walls is sucked out during construction, creating a vacuum. Instead of containing some kind of heating element to keep hot things hot, a thermos is designed to keep hot things hot by not allowing heat to escape.
Heat can be transferred through the air. To keep heat from escaping, you need insulation. The best insulator possible is a vacuum, because there's no air. If there's no air to transfer heat, then the heat is retained where it is — and where you want it: in your food.
A thermos keeps cold things cold in the same way. It doesn't contain some kind of cooling device. The same vacuum that keeps hot things hot keeps cold things cold. Heat that might otherwise transfer to the cold contents of the thermos is prevented from reaching it because of the vacuum between the thermos walls.