An air conditioning unit can both heat and cool by using a process called refrigeration. Refrigeration works by transferring heat from one place to another, and this process can be reversed to provide both cooling and heating.