Confocal scanners use a laser beam to illuminate a specific point on the specimen. The reflected light from this point passes through a pinhole before reaching the detector. By scanning the laser across the specimen and capturing multiple images at different focal planes, confocal scanners can construct a three-dimensional image of the tissue. This technique is known as optical sectioning.