From the definition of the first Law of thermodynamics we know that heat flows from the hottest object to the coldest. What has a refrigerator inside is a refrigerant that is traveling through some heat exchangers, driven by pumps and that allows the exchange of heat between a 'Hot' tank and then transport it to a certain place, eject it and return to extract more heat. In this way the refrigerant removes heat from a hot region to a cold region and heat enters said hot region. Since the heat extracted is greater than that of the medium, the heat from the inside flows outward.
The correct answer is B.