Understanding the way in which large-scale structures like galaxies form remains the most challenging problem in cosmology today. This text provides an up-to-date and pedagogical introduction to this exciting area of research. Each chapter is accompanied by a comprehensive set of exercises to help the reader in self-study.