Although gasoline engines have improved a lot, they are still not very efficient at turning chemical energy into mechanical power. Most of the energy in the gasoline (perhaps 70%) is converted into heat, and it is the job of the cooling system to take care of that heat. The cooling system on a car driving down the freeway dissipates enough heat to heat two average-sized houses! The primary job of the cooling system is to keep the engine from overheating by transferring this heat to the air, but the cooling system also has several other important jobs.
The engine in your car runs best at a fairly high temperature. When the engine is cold, components wear out faster, and the engine is less efficient and emits more pollution. So another important job of the cooling system is to allow the engine to heat up as quickly as possible, and then to keep the engine at a constant temperature.