Sonar uses sound waves to detect objects underwater. It works by transmitting sound pulses and measuring the time it takes for the echo to return from objects. The speed of sound in water is known, so the distance to the object can be calculated. Sonar has applications like finding depth, locating ships and submarines, and ocean surveillance. It is also used by navies but can negatively impact marine animals that use sound for navigation.