The halide ion is a very weak base. Halogen is easily displaced in alkyl halides by stronger bases (nucleophiles). Thus halogens are good leaving groups. The nucleophillic substitution reactions shown below also apply to other good leaving groups such as aryl sulfonates.
(Williamson Synthesis)
(Friedel Crafts reaction)
(Malonic ester synthesis)
(Acetoacetic ester synthesis)