Scanning probe microscopy is one of the most important surface science methods for characterizing a variety of different surface and subsurface properties at the nanoscale. Atomic force microscopy, and in particular Kelvin probe force microscopy (KPFM), allows the detection of atomic scale forces and separation into their different components, namely Van der Waals, magnetic, electric and chemical bonding forces. KPFM allows the electrostatic forces to be separated from these components and the work function, surface band bending, and electric dipole strength to be determined at the nanometer scale. In the talk, I will present the different techniques used to perform these measurements using various examples and discuss the advantages and disadvantages of these techniques. Finally, I will also discuss the spectroscopy mode and the determination of the local work function differences at molecular and atomic scales.