The Mean-Field Theory in the Study of Ferromagnets and the Magnetocaloric Effect