This article introduces density functional theory, starting from the ground-state theory and assuming a background in quantum mechanics and statistical mechanics. We review the foundations of density functional theory (DFT) by illustrating some of its key reformulations. The basics of DFT for thermal ensembles are explained, as are tools useful for analysis and development of approximations. ...