The origins of wavefront sensing lie in astronomy, where Shack-Hartmann sensors and adaptive optics were first used to increase the imaging quality of telescopes in the 1980s. Measuring the wavefront or optical phase of a light beam is critical for assessing the quality of an optical system and optimizing its performance. When light passes through an imperfect optical component, aberrations or wavefront errors are generated. By measuring these errors with a wavefront sensor, they can be either corrected or minimized. One way of correcting the wavefront is by using adaptive optics such as a deformable mirror. In this talk, after describing the Shack-Hartmann technique and the principle of adaptive optics, a wide range of wavefront sensor applications will be introduced, including optical trapping of atoms, optics characterization, surface metrology and microscopy.