Electronic structure problems are studied in condensed matter physics and theoretical chemistry to provide important insights into the properties of matter. This graduate textbook describes the main theoretical approaches and computational techniques, from the simplest approximations to the most sophisticated methods. It starts with a detailed description of the various theoretical approaches to calculating the electronic structure of solids and molecules, including density-functional theory and chemical methods based on Hartree-Fock theory. The basic approximations are thoroughly discussed, and an in-depth overview of recent advances and alternative approaches in DFT is given. The second part discusses the different practical methods used to solve the electronic structure problem computationally, for both DFT and Hartree-Fock approaches. Adopting a unique and open approach, this textbook is aimed at graduate students in physics and chemistry, and is intended to improve communication between these communities. It also serves as a reference for researchers entering the field.