Disclaimer: These are my own strategies towards composition. Use what works best for you since mine are usually geared towards being economically frugal.
First let's look at the situation before tech 13 for any non-horde nation.
I like to use all infantry with 2 cavalry for flanking. Cavalry cost 250% of what infantry cost so that is why I keep very few of them. They are far, far stronger, but keeping my army light and my wallet fat is important to me.
But if I'm going to fight a battle which I absolutely must win, I prefer to look at my enemy's army and counter it specifically.
Let's say the enemy is a stack of 14INF/6CAV/5ART. This means the front line is going to be 20 units wide. I would want to bring 24 units in this case because (until later technologies) you can effectively flank with up to 4 units, provided at least two of them are cavalry and they are at full strength.
But instead of just bringing 22 infantry and 2 cavalry, I would want to have as much cavalry as possible while avoiding losing "tactics" from having too much. For a western tech country you cannot have more then 1 cavalry for each infantryman. Assuming I were a western power in this hypothetical battle, I would bring 14 infantry and 10 cavalry. Bringing 12 of each would be bad because during the battle your infantry would suffer more losses than your cavalry and as soon as your infantry numbers fell below your cavalry numbers, you would lose some tactics, which means you take greater losses. Like I said, at this stage I would not consider using cannons at all because they are very expensive and before tech 13 I see them as only good for sieging. Some people will disagree with this, but that's what makes the strategies interesting.
The situation before tech 13 for a horde nation is quite straightforward. All cavalry all the time in battle. mercenary infantry are for sieging to save on manpower and the cavalry can loot and protect. In a battle I want to bring 4 more units than the enemy on the frontline to flank. Hiring non-mercenary infantry as a horde is just not something I do.
After tech 13, I want my back row full of cannons. This is not economically viable most of the time, but generally I will attach more and more cannons to my armies as time goes on and the budget allows it.
When it comes to huge battles after tech 13, you want full combat width of cannons the whole time or you are going to be very disadvantaged.
Again it bears repeating, this is my own strategy towards composition. I recommend it, but find whatever works for you. Luck, terrain, logistics and leaders all come into play too so no composition alone is going to win a battle, let alone a war.