HVAC systems have three main functions - heating, ventilation, and air conditioning. They work to provide thermal comfort and indoor air quality. HVAC systems use the principles of thermodynamics, fluid mechanics, and heat transfer to achieve this. They are used in both residential and commercial buildings to control temperature, humidity, and air quality. Common components of HVAC systems include a central heating unit, ventilation to exchange air, and air conditioning using a refrigeration cycle to cool indoor air.