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 to draft your colonists as soldiers.
To draft a colonist, press the button marked with two crossed swords. Unlike a colonist, a drafted colonist can be precisely controlled as in deciding where he/she shall stand, what target to fire upon and so on. Draftees 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.
For ranged colonists there is a 'Fire at will' option which defaults to 'On'. When turned on the colonist will freely engage any targets within ran, shooting at them. If turned off you will need to manually direct the colonist to shoot at a specific target.
A draftee 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.
Draftees can arrest colonists and neutral human characters, dragging them to the nearest convenient bed marked for prisoners. This can be used to 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 draftee can be directly ordered to move where you want them to, and shoot what you tell them to. To move a draftee, 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 draftee 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 colonist won't have been able to fulfill their needs and could begin to starve or suffer a mental breakdown. Undraft the colonist to allow them to rest and address their needs.
See also: Combat