Preparation by substitution reactions

The alcohol functional group is very versatile in that alcohols can be prepared in a variety of ways. Alcohols can be converted to halides by reactions that result in substitution at saturated carbon.  In the substitution reaction the C-O bond is broken and a new bond to halogen is made at the same carbon. 

 

Thus primary, secondary and tertiary halides can be prepared from the corresponding alcohols.

Substitution reactions are more facile if the reactant bears a better leaving group.
Good leaving groups have atoms that are capable of bearing negative charge.
Weaker bases are better leaving groups. Thus OH is not a good leaving group.

Reagents that convert alcohols to halides interact with OH to make it a better leaving group.
HCl or HBr (the HX protonates the OH giving R-OH2+. X displaces the weak base H2O).
SOCl2 (reacts with ROH to form ROSOCl that reacts by substitution more readily)
PCl3, PCl5 (reacts with ROH to form phosphate esters that react by substitution more readily)