We review the study of inhomogeneous perturbations about a homogeneous and isotropic background cosmology. We adopt a coordinate based approach, but give geometrical interpretations of metric perturbations in terms of the expansion, shear and curvature of constant-time hypersurfaces and the orthogonal timelike vector field. We give the gauge transformation rules for metric and matter variables at first and second order. We show how gauge invariant variables are constructed by identifying geometric or matter variables in physically-defined coordinate systems, and give the relations between many commonly used gauge-invariant variables. In particular we show how the Einstein equations or energy-momentum conservation can be used to obtain simple evolution equations at linear order, and discuss extensions to non-linear order. We present evolution equations for systems with multiple interacting fluids and scalar fields, identifying adiabatic and entropy perturbations. As an application we consider the origin of primordial curvature and isocurvature perturbations from field perturbations during inflation in the very early universe.