Attacking Towns will give you a lot of goods so bring many ships or crew (depending if you want to attack by land or sea). The defenses for bigger towns are usually stronger. You will need a Letter of Marque or your reputation will drop dramatically and you may lose everything. You should probably go into the harbour and check that there are no military convoys in the town before attacking. You may have to duel the Town Commander if you succeed with the attack.
This is probably the cheaper option if you have a lot of boats fairly early on in the game. Check the army of the town and see if you have more crew than the army (or around the same amount) then you should be fine. Either go for a full frontal assault on one of the gates or set about 2 armies to go to the second gate, attack the first gate, wait for all the soldiers near the second gate to abandon it and attack, you have a good chance of succeeding if they are engaging the soldiers attacking the first gate.
This is more simple, destroy all the towers, you will have to destroy the towns cannons. Use your ships to hit them like attacking a pirate town, this will be a bit harder though as the towers are grouped together.