The aim is to create an artificial star of known size and shape. A very narrow laser beam tuned to exactly the same wavelength of sodium light stimulates fluorescence at the same wavelength from sodium in the upper atmosphere. (Incidentally, that sodium comes primarily from sea salt.)
A telescope looking at that fluorescent spot should see an immobile spot with a shape and diameter set by the resolution of the optics. In practice it sees a large shimmering moving blob because of the atmosphere. Clever software quickly works out what distortions should be made to the telescope to return that blob to its undistorted shape and very fast mechanical actuators then make the corresponding movements to an optical element. Voila, diffraction-limited images through adaptive optics.