When the compressor of refrigerator starts working, the cooled gas in compressor and circuit is sent to the evaporator container (freezer compartment) with pressure. The gas absorbs the heat inside the freezer compartment container and heats up. With the suction of compressor, this gas exits the fridge environment again and moves to the radiator (condenser) on the back of refrigerator. The gas cools there and circulates again through the compressor. This function repeats regularly to the extent that the freezer compartment temperature reaches the intended temperature.
In fact, the refrigerator absorbs the heat of stuff inside it and transfers it to the room environment and in this way the stuffs inside it get cool.