Fish are equipped with an air bladder inside their bodies. As the fish adds air to its swim bladder, it increases its volume. The fish s mass stays the same. Shrinking the swim bladder decreases the fish s volume. When the fish s volume decreases, its mass occupies less space so the fish sinks.
Fish use their swim bladders to maintain neutral buoyancy, or stay at one level.
That way, they don't have to expend much energy to stay in one place. Submarines are rigid, so they cannot change their volume. To achieve buoyancy, submarines use a ballast tank. A ballast tank holds water. Sailors must pump water in and out of the ballast tank.