To create a detachment, simply choose a unit with the 'Detachment' special rule and create a unit as follows:
A detachment can range in size from a minimum of five models to a maximum of half the number of models in the regimental unit it accompanies (rounding down).
The models in a detachment can purchase any optional upgrades listed as normal.
A detachment cannot include a command group or any command models.
A detachment must accompany a regimental unit. This means that every detachment included in your army must be assigned to a regimental unit and a note made of this on your muster list. A detachment cannot be assigned to more than one regimental unit.
Detachments are normal units in all regards that benefit from additional rules. With the exception of these special rules, detachments are completely separate and independent from their regimental unit (i.e., spells, magic items and special rules affecting the regimental unit do not affect its detachments unless specifically stated otherwise).