How did early humans use fire?

At first they used it for warmth -- and sometimes to scare off wild animals. Eventually they learned to use fire to cook food.