A flask is a device which can retain the temperature of the substances inside it by eliminating the loss of heat from inside to outside or vice versa and as a result a hot object remains hot and a cold object cold.
We know that heat can flow from one place to another by three processes: conduction, convection and radiation. The thermos flask prevents the flow of heat by any of these processes. The flask is made up of glass which is a bad conductor of heat. Hence heat does not flow by conduction. Since there is vacuum between the walls of the bottle, flow of heat by convection is also ruled out. Due to the silvering of the walls heat is not lost by radiation. As a result, hot things kept in a vaccum flask, do not become cold and cold ones do not become hot for a long time.