An unarmed colony is not going to last long out in the wilderness. In order to defend yourself from armed incursion from raiders and mechanoids, and maintain order in your colony when colonists start suffering mental breaks, you're going to need soldiers.
To make a soldier, select a colonist and press the button marked with two crossed swords. Unlike a colonist, a soldier can be precisely controlled as in deciding where he/she shall stand, what target to fire upon and so on. Soldiers will also use any viable terrain features or structures they're standing next to as cover to protect themselves during a firefight with your enemies.
A soldier carrying a weapon will hold it out and ready at all times, automatically attacking any hostile character or animal that comes within range. If you draft a colonist who does not have a weapon, you will be immediately notified of such -- it is advised to always ensure soldiers are armed, unless you want them to use their bare fists to subdue someone with a minimal chance of killing or crippling them. Note that soldiers equipped with ranged weapons can still attack with their fists if ordered to engage in melee, or if engaged by an attacker in melee combat.
Soldiers can arrest colonists and neutral human characters (such as drifters), dragging them to the nearest convenient bed marked for prisoners. They can also arrest colonists who have suffered a non-violent mental breakdown, which can be very helpful if someone starts binging on alcohol or gives up and tries to leave the colony entirely. To do so, select a soldier and right-click the desired captive, then select "arrest <name>" from the menu.
While drafted any assigned animals will disregard their allowed areas and will follow and defend their master against nearby enemies. If the colonist has any animals trained for Release, clicking the 'Release animals' button will let animals leave their master's side to go attack enemies.
A soldier can be directly ordered to move where you want them to, and shoot what you tell them to. To move a soldier, select them, then right-click on any pathable tile on the map. If you band-box select multiple soldiers at once, you can order them all to move to the same area.
A soldier can train to increase their shooting skill by having them fire a ranged weapon at something that can't be destroyed, such as a grave, sleeping spot, or crafting spot. Be aware that if left drafted for too long, the soldier won't have been able to fulfill their needs and could begin to starve or suffer a mental breakdown. Undraft the soldier to allow them to rest and address their needs.
See also: Combat