UV/Vis/NIR is used to record the absorption/transmission/reflection spectrum of a material, from which the band gap of the material can be found.
In several machines such as Perkin Elmer, you may choose UV/Vis/NIR absorption, transmission and diffuse reflection mode according to your sample.
If you are dealing with some nano particles or nanotubes then you may disperse a little amount of sample material in ethanol or acetone or chloroform (according to your type of your sample, sample should not react with the liquid medium) by ultra sonication and make an optically clean solution so that successive scattering happens. Then you pour that dispersion into a quartz cuvette. First take the absorption spectrum of the bare liquid medium, auto zero it and the take the absorption spectrum of the material dispersed liquid.
For transparent thin film you just put the substrate at the niche, do auto zero, then take it out put your sample take absorption spectrum.
For diffuse reflection mode, you also have to fix your sample at the right place according to your machine and do the same thing.
UV/Vis/NIR spectrum of a material reveals a lot of information about the material, such as whether the material is wide band gap material (Abs peak in UV region), whether it absorbs visible light (peak or hump in visible region), whether it has defect states (long tail) etc.
In additon to ayan's answer, UV/Vis spectroscopy is a tool to help us for analyzing characteristics of nanomaterials in terms of its energy (band - gap) whether it can be applied as semiconductors, superconductors, photocatalysts or photoluminescent and etc. and also defects as mentioned before