Room-temperature ionic liquids (RTILs) have exciting properties such as nonvolatility, large electrochemical windows, and remarkable variety, drawing much interest in energy storage, gating, electrocatalysis, tunable lubrication, and other applications. Confined RTILs appear in various situations, for instance, in pores of nanostructured electrodes of supercapacitors and batteries, as such electrodes increase the contact area with RTILs and enhance the total capacitance and stored energy, between crossed cylinders in surface force balance experiments, between a tip and a sample in atomic force microscopy, and between sliding surfaces in tribology experiments, where RTILs act as lubricants. The properties and functioning of RTILs in confinement, especially nanoconfinement, result in fascinating structural and dynamic phenomena, including layering, overscreening and crowding, nanoscale capillary freezing, quantized and electrotunable friction, and superionic state. This review offers a comprehensive analysis of the fundamental physical phenomena controlling the properties of such systems and the current state-of-the-art theoretical and simulation approaches developed for their description. We discuss these approaches sequentially by increasing atomistic complexity, paying particular attention to new physical phenomena emerging in nanoscale confinement. This review covers theoretical models, most of which are based on mapping the problems on pertinent statistical mechanics models with exact analytical solutions, allowing systematic analysis and new physical insights to develop more easily. We also describe a classical density functional theory, which offers a reliable and computationally inexpensive tool to account for some microscopic details and correlations that simplified models often fail to consider. Molecular simulations play a vital role in studying confined ionic liquids, enabling deep microscopic insights otherwise unavailable to researchers. We describe the basics of various simulation approaches and discuss their challenges and applicability to specific problems, focusing on RTIL structure in cylindrical and slit confinement and how it relates to friction and capacitive and dynamic properties of confined ions.