An air conditioner functions by drawing in warm indoor air, passing it over cold coils filled with refrigerant, which absorbs heat and cools the air. The cooled air is then circulated back into the room. The absorbed heat is expelled outside, and the cycle repeats, maintaining a comfortable indoor temperature.