Distillation works because liquids boil at different temperatures. Roughly speaking, in order to separate two liquids, you should heat the mixture to a temperature where one of the liquids (but not the other) is past its boiling temperature. Then the first liquid will boil off, leaving the second liquid behind; you can collect the first liquid in a condenser.