The singular value decomposition
Every matrix sends some perpendicular pair of unit vectors to a perpendicular pair stretched by the singular values, the axes of the ellipse it makes from the unit circle, so every matrix factors as $A = U\Sigma V^T$, and setting the smallest singular values to $0$ gives the closest matrix of lower rank.
From Linear Algebra.