Halohydrins are usually prepared by treatment of an alkene with a halogen, in the presence of water. The reaction is a form of electrophilic addition, with the halogen acting as electrophile.  In that regard, it resembles the halogen addition reaction and proceeds with anti addition, leaving the newly added X and OH groups in a trans configuration. The chemical equation for the conversion of ethylene to ethylene chlorohydrin is:
:HC=CH  +  Cl + HO → H(OH)C-CHCl + HCl
When bromination is desired, N-bromosuccinimide (NBS) can be preferable to bromine because fewer side-products are produced.