The gills of a fish work by absorbing oxygen from the water and replacing it with carbon dioxide.