An AFM operates by scanning a sharp tip over the sample surface. The interactions between the tip and the surface are measured and used to construct detailed images of the surface topography. AFMs can also measure mechanical properties like stiffness and adhesion, making them versatile tools in nanomaterials research.