The past few decades have seen a rapid increase in the use of functional near-infrared spectroscopy (fNIRS) in cognitive neuroscience. This fast growth is due to the several advances that fNIRS offers over the other neuroimaging modalities such as functional magnetic resonance imaging and electroencephalography/magnetoencephalography. In particular, fNIRS is harmless, tolerant to bodily movements, and highly portable, being suitable for all possible participant populations, from newborns to the elderly and experimental settings, both inside and outside the laboratory. In this review we aim to provide a comprehensive and state-of-the-art review of fNIRS basics, technical developments, and applications. In particular, we discuss some of the open challenges and the potential of fNIRS for cognitive neuroscience research, with a particular focus on neuroimaging in naturalistic environments and social cognitive neuroscience.