Thermodynamics and its applications