Answer:
so heating a magnet disrupts the domain walls and it becomes easy for the magnet to become ordinarily misaligned and rotate. so when that happens they are now less aligned and point in the opposite direction to the neighbors causing a decrease in the magnetic field and loss of magnetism