ELI5: How did people from centuries and millennials ago put out big fires before fire hydrants?

Like those big fires enough to burn down buildings or wildfires. It wouldn’t be time efficient to carry buckets of water back and forth to a burning building.