Why do Fish have Gills?

Fish just like humans needs to breathe to live. Unlike humans they don’t have lungs but uses their gills to breathe with. The gills take out the oxygen from the water it has swallowed then released the water back out.