An atomic force microscope (AFM) isn’t anything like an optical microscope that you simply look through to make small things appear bigger. The key step enabling such studies is an atomically controlled functionalization of the microscope tip. The tip of an AFM (also called a probe) is so small that you need an electron microscope to even see it.
To operate, the tip of the AFM moves across a surface, and when it encounters an atom or a molecule, the tip bumps up a little bit as it passes over.
This jiggles a laser beam, which records precisely how much the tip was deflected. By making a bunch of passes, the AFM can gradually build up a sort of topographic map of a surface.
It’s also possible to place a single atom on the very tip of the AFM’s probe, and by watching how that atom interacts with the atoms that it passes over, you can tell what’s underneath.