This book introduces quantum field theory, together with its most important applications to cosmology and astroparticle physics, in a coherent framework. The path integral approach is employed right from the start, and the use of Green functions and generating functionals is illustrated first in quantum mechanics and then in scalar field theory. Massless spin one and two fields are discussed on an equal footing, and gravity is presented as a gauge theory in close analogy with the Yang-Mills case. Concepts relevant to modern research such as helicity methods, effective theories, decoupling, or the stability of the electroweak vacuum are introduced. Various applications such as topological defects, dark matter, baryogenesis, processes in external gravitational fields, inflation and black holes help students to bridge the gap between undergraduate courses and the research literature.