Guided modes in nanometer thick anisotropic van der Waals materials are experimentally investigated and their refractive indices in visible wavelengths are extracted. Our method involves near-field scanning optical microscopy of waveguide (transverse electric) and surface plasmon polariton (transverse magnetic) modes in h-BN/SiO2/Si and Ag/h-BN stacks, respectively. We determine the dispersion of these modes and use this relationship to extract anisotropic refractive indices of h-BN flakes. In the wavelength interval 550–700 nm, the in-plane and out-of-plane refractive indices are in the range 1.98–2.12 and 1.45–2.12, respectively. Our approach of using near-field scanning optical microscopy allows for the direct study of the interaction between light and two-dimensional van der Waals materials and heterostructures.