The process of adsorbing oxygen and the release of carbon dioxide is called ‘gas exchange’. Fish need oxygen in the same way humans do, they just go about getting it in a different way.
A fish has gills behind its mouth, on the side of the head. Each gill begins with a gill arch which then splits into two filaments, much like a wishbone. Those filaments are lined with lamellae, which are little discs that are filled with capillaries. Those capillaries have oxygenated blood running through them, which is why the inside of gills are red. The more active a fish is, the more oxygen it needs, and the more lamellae it has.
As a fish swims, the water moves into the mouth and flows through the gills. When a fish is stationary; it can still push water through the gills by opening and closing its mouth. When water passes over the lamellae, the oxygen in the water diffuses into the capillaries, oxygenating the blood.
Fish have a ‘counter current system of flow’, which means that the blood flows in the opposite direction of the water. They need this clever little trick because the diffusion only works if there is less oxygen in the blood than there is in the water. So, the blood with the least amount of oxygen is meeting the ‘oxygen depleted’ water first, taking what’s left, and then moving on to fresher, more oxygenated water.
Like humans, fish must get rid of the carbon dioxide created by absorbing and using oxygen. Gills are multi-taskers, they diffuse the carbon dioxide out of the body and into the water. Fish are then free to focus on swimming.