The principle behind confocal microscopy involves the use of a laser to scan the specimen point by point. The emitted fluorescence from the sample is filtered through a pinhole, which blocks out-of-focus light. This results in a sharp image of a thin slice of the specimen. By stacking these slices, a three-dimensional reconstruction can be achieved.