Attack enemies that your military advisor calls average in comparison to your strength or if they are weaker. If their strength is average compared to you, you should be able to roll over them.
If the units are from the same age like swords vs spears, knights vs pikes and cavalry vs muskets, send at least 2 attackers for every defender you expect to see. If your units are more advanced like knights vs spears or cavalry vs pikes, you can do with slightly less than 2 per defender. If your units are weaker like swords vs pikes or knights vs muskets, send at least 3 for every defender you expect. If you are using horses against spears, you also want 3 attackers per defender.
If the enemy town is on a hill, simply consider spears to be pikes and pikes to be muskets. Then look at what you have to attack them.
You can find out their amount of defenders by investigating cities before the war. If you cannot investigate, expect 2-3 in every city in ancient and early middle ages. Double or more that amount in the capital. Later in the game, the number can go up, certainly if the AI does not fight anyone to burn some units. You can also find out about their defences by bombarding, you can count the number of units that you damage. This is not enough of a reason to build catapults though, it is just a usefull thing to do if you happen to have bombardment units anyway. (don't forget naval bombardment on coastal cities)
Sometimes, the AI builds more units than it can support. This will reduce its tech pace as he will be paying all his commerce for upkeep. With no new techs, he wont get new buildings to make and thus will keep building more units. If you can't get this AI to fight a war, you might have dozens of units in all cities. This is something that won't happen a lot on emperor, but i guess it could happen there as well. The higher the level, the more often this happens. Something to look out for.
You can reduce their number of units by first allying another AI against them.
When you attack a city, it is important that you really take it. If you damage the units, but fail to capture the city, you have lost units and his units will heal. Therefore, better send too many than too few.