Osmoregulation is how living things keep the right amount of salt and water in their bodies. All living things do this, from bacteria to humans.
The basic idea is that organisms keep osmotic pressure by controlling their water and salt concentrations. There are regulators and conformers. Conformers match their environment, and regulators do things which act to keep their internal water at a standard level of saltiness.
Sea fish, for example, tend to gain salt if they live in seawater. So they actively put out (excrete) salt from their gills. River fish, on the other hand, take the salt out before they excrete water. Some fish, like the flounder, live in both fresh and salt water at different stages in its life. They adapt to whichever water they are in.