The same way your refrigerator chills your soda. Both your fridge and your house’s A/C absorb heat into coils filled with special refrigerant chemicals. The coils remove the heat from the house (or fridge), leaving the air inside comfortably chilly.
When hot air flows over the cold, low-pressure evaporator coils, the refrigerant inside absorbs heat as it changes from a liquid to a gaseous state. To keep cooling efficiently, the air conditioner has to convert the refrigerant gas back to a liquid again. To do that, a compressor puts the gas under high pressure, a process that creates unwanted heat. All the extra heat created by compressing the gas is then evacuated to the outdoors with the help of a second set of coils called condenser coils, and a second fan. As the gas cools, it changes back to a liquid, and the process starts all over again.
Picture Credit : Google