The basic unit of defense is a squad of soldiers. These are trained in castles, and need weapons in the course of their training. Please note that the smallest castle becomes available in the construction menu when your population has reached both the "SETTLER" level and a certain size. Build a castle, go into info mode and then click it. The castle menu then shows the different trades available:
Click a specialty, and then the training symbol. The training then begins in the castle, and the specialty chosen appears in one of the blue squares. The soldiers are available for the duration of the training period, which is shown by a counter. The soldiers can first be used when the counter has reached 10, and the weapons appropriate to their specialty have been collected from the marketplace.
Click the dispatch button, and then the place where the soldier is to be assigned. The now fully trained squad then leaves the castle and proceeds to the designated location.
Please note that each soldier you see represents a squad of soldiers. Each squad needs a certain amount of weaponry, depending on their specialty. You will either have to produce or buy these. The orange bar in the training window shows whether you have enough weapons to finish the squad's training and dispatch them or not. When the bar turns red it means that you now have enough weapons for the squad.