Castles and defensive structures built of wood and stone help you protect your settlement from attack. Stone structures are naturally better than wood, but they are also more expensive. Each watchtower has 2 cannon, and is most useful when placed on the coast,where it can better defend against attacking ships. You shouldn't rely on defensive structures alone, however. Keep a small troop of soldiers ready to counter possible attacks. Above all, protect your warehouse and marketplaces, for your city stands, or falls, with them.
Before attacking someone else, you should watch your opponent and see what resistance you can expect. See which tactic is appropriate to which terrain. Also keep in mind that soldiers are not only expensive to have, they are also expensive to train. A balance between population, income, production levels, and troops is necessary. If you invest too much money in armies, it can rob you of much needed revenue.