AFM operates by scanning a sharp probe, known as a cantilever, over the surface of a sample. The cantilever is sensitive to forces between the tip and the sample surface, such as van der Waals forces, electrostatic forces, and mechanical contact forces. As the probe moves across the sample, it deflects according to the surface's topology. A laser beam reflected off the back of the cantilever measures these deflections, translating them into a high-resolution image.