The theory of thermodynamics has been one of the bedrocks of 19th-century physics, and thermodynamic problems have inspired Planck's quantum hypothesis. One hundred years later, in an era where we design increasingly sophisticated nanotechnologies, researchers in quantum physics have been 'returning to their roots', attempting to reconcile modern nanoscale devices with the theory of thermodynamics. This textbook explains how it is possible to unify the two opposite pictures of microscopic quantum physics and macroscopic thermodynamics in one consistent framework, proving that the ancient theory of thermodynamics still offers many remarkable insights into present-day problems. This textbook focuses on the microscopic derivation and understanding of key principles and concepts and their interrelation. The topics covered in this book include (quantum) stochastic processes, (quantum) master equations, local detailed balance, classical stochastic thermodynamics, (quantum) fluctuation