Fish use their gills. Gills are networks of capillaries that bring the blood close to the oxygenated water. To do so, capillaries have very thin walls to minimize the distance between the red blood cells and the water. They also have enormous surface area. This increases the amount of oxygen that comes into contact with blood.
When fish is submerged, gills are buoyant and the capillaries are supported by buoyancy. But taking the fish out to the water causes the gills to collapse under their own weight. The fish could potentially breathe the oxygen-rich air, but the collapsed gills do not allow blood to get in contact with air.