Gills are used by fish, and some other aquatic creatures, to allow gas exchange to take place between the surrounding water and the bloodstream.
The main function of gills is to obtain oxygen from the surrounding water for the purposes of respiration, and at the same time waste products are also released.
The gills are made up from many gill filaments through which blood is passed through. The walls of these filaments are very thin and allow the transferral of gasses to and from the surrounding water and the bloodstream.
Low-oxygenated blood is circulated through the gill filaments and high-oxygen water passed over them in opposite directions. Some of the oxygen from the water is diffused through the gill filaments into the bloodstream, and carried away to the fish's organs.
Gills are also used as part of a fishes osmoregulatory system, which keeps a constant level of body salts in relation to the surrounding environment. This is done by the release of, or retaining of salts at the gills.