Magnetic refrigerants heat up when they are subjected to a magnetic field because the second law of thermodynamics states that the entropy - or disorder - of a closed system must increase with time. This is because the electron spins in the atoms of the material are aligned by the magnetic field, which reduces entropy.
To compensate for this, the motion of the atoms becomes more random, and the material heats up. In a magnetic refrigerator, this heat would be carried away by water or by air. When the magnetic field is turned off, the electron spins become random again and the temperature of the material falls below that of its surroundings. This allows it to absorb more unwanted heat, and the cycle begins again.
Producing very low temperature through the process of adiabatic demagnetisation can do refrigeration. The paramagnetic salt is suspended by a thread in a tube containing a low pressure of gaseous helium to provide thermal communication with the surrounding bath of pumped helium. In operation the liquid helium bath is cooled by pumping to the lowest practical pressure, usually achieving a temperature in the neighbourhood of 1oK. The temperature of the paramagnetic salt approaches that of the helium bath by conduction through the exchange gas.