We present an optimal probabilistic protocol to distill quantum coherence. Inspired by a specific entanglement distillation protocol, our main result yields a strictly incoherent operation that produces one of a family of maximally coherent states of variable dimension from any pure quantum state. We also expand this protocol to the case where it is possible, for some initial states, to avert any waste of resources as far as the output states are concerned, by exploiting an additional transformation into a suitable intermediate state. These results provide practical schemes for efficient quantum resource manipulation.