What are the physiological mechanisms that enable fish to extract oxygen from water?

How do fish overcome oxygen limitations during periods of high activity or stress?
How do fish adapt to extreme environments, such as saltwater or freshwater habitats?