Confocal microscopy employs a laser to illuminate a small spot on the sample. The emitted light passes through a pinhole before reaching the detector, which ensures that only light from the focal plane is captured. This technique is combined with a scanning mechanism that moves the laser beam across the sample, building a detailed image pixel by pixel.