Based on what I learned from playing campaigns plus the advices of certain people from this forum, I'll mention a compilation of tips ( specially for people who have no or just little experience playing campaigns ):
A- If you have range siege units:
- I would recommend setting them on normal shot because normal shots are more accurate. And disabling fire at will to save ammunition. And manually aim at the towers that might cause problems to your units ( typically the two towers that above the gate. Then you can destroy the gate with either a battering ram or by burning it with your military units ). And try to open at least one section on the walls. Ideally in a place that is out of any tower's range.
B- If you don't have any range siege unit:
- In case you have the time to besiege the city for 2 or more turns, always prioritize building tortoise siege units if available. They are the best option when you have no range siege unit. Try to get at least 2 of them. When you open at least one or two breaches on the walls ( ideally where no tower would affect your units you send there to try to make their way into the city. As you know, the enemy would likely send melee units on the wall breach to try to prevent your troops from getting inside the city ).
Note: You can't have tortoise units if the walled city you are going to assault is barbarian. They aren't available.
C- If you don't have any range siege unit nor any tortoise available to build:
In this case you have no other option than relying on ladders or siege towers. This is the case when your army or armies ( if you use 2 armies to attack ) missile units should be exclusively archers and not slingers nor javelin men. This is why: Because you'll need to provide your melee units with covering fire ( by aiming at the enemy missile units ) in case the enemy missile units retreat inside the city once your melee units get to the walls. Slingers and javelin men can't shoot over the walls from outside the city. But archers can. Set your archers in guard mode so that they stay where they are when shooting. Disable fire at will to save ammo because you need to shoot the enemy archers or slingers or javelin men because otherwise they could massacre your melee units that are fighting on the walls.
An additional tip for this case when there is no range siege unit nor tortoise available is having melee units to serve as cannon fodders in order to reserve your strong units. Your second army should have auxiliary or mercenary units to be sent first in the ladders and siege towers in order to get them to disable the two towers ( the two towers that are above a gate ) firing and to destroy the gate as well. The two towers stop firing when your units are on the wall above the gate.
If the city you attack is barbarian, you can use your archers to destroy towers while your units are advancing to the gate in ladders or siege towers. Set your achers on flaming shot mode for that.
Addtional tip:
Another useful thing in case you have no range siege unit nor any tortoise unit and if the walled city is a coastal city, you should use one army plus one navy to attack. Ideally try to have at least 3 ballista ships in order to destroy some towers ( Always shoot on normal mode shot because it is more accurate ) in order to make the disembarking action safe for your marine units ( In case there is a way to disembark inside the city ). They can later capture towers and gates in order to support your land army and help them get inside the city as fast as possible.
Don't forget that most of your units should be infantry in a walled city assault battle