The third law of thermodynamics has a controversial past and a number of formulations due to Planck, Einstein, and Nernst. It's most accepted version, the unattainability principle, states that "any thermodynamic process cannot reach the temperature of absolute zero by a finite number of steps and within a finite time". Although formulated in 1912, there has been no general proof of the principle, and the only evidence we have for it is that particular cooling methods become less efficient as a the temperature lowers. Here we provide the first derivation of a general unattainability principle, which applies to arbitrary cooling processes, even those exploiting the laws of quantum mechanics or involving an infinite-dimensional reservoir. We quantify the resources needed to cool a system to any particular temperature, and translate these resources into a minimal time or number of steps by considering the notion of a Cooling Machine which obeys similar restrictions to universal computers. We generally find that the obtainable temperature scales as an inverse power of the cooling time, and place ultimate bounds on the speed at which information can be erased.