Magnetic refrigeration is a cooling technology based on the magnetocaloric effect. When the material passes through the magnetic field. Magnetic entropy is reduced.
So when the magnetic entropy is reduced Lattice and electronic entropy increases to compensate. The temperature of the material increases.When material is removed from the magnetic field. Magnetic spin it back up in its original condition by getting energy from Lattice. This makes thermal entropy decreases with decreasing temperature materials