The following basic combat principles and tips are intended to help starting off your career as a wesnothian battle veteran. The minor concrete examples are somewhat tied to the "Heir to the Throne" campaign.
Don't waste units
Do not send wounded units to a sure death. Once a unit loses more than half of its hit points (HP), you should seriously consider retreating it to safety and either station it in a village for healing or give him to the care of a healer (like Elvish Shamans or White Mages). Healers are very useful!
This is for practical reasons: a heavily wounded unit cannot hold back or kill the enemy. During attack and counterattack, it most often will perish. Further, by sending it to its sure death, its gathered experience points (XP) are lost. Recruiting a replacement may be impossible because the leader is not in its keep or because funds are running low. Even if you can recruit a replacement, it is most often far away from the battle front. So don't waste your units.
Out of the enemy's reach
How do you guard wounded units? They are best guarded by being out of the adversary's reach. No enemy can attack them if enemies cannot even come near them. The next section about zone of control (ZOC) shows how to restrict the enemy's moves.
In the Action menu, you can select "Show Enemy Moves" to highlight all possible hexes your adversary can actually move to. This takes your zone of control into account. Thus you can check that your near death unit, which is behind, indeed cannot be attacked as the enemy cannot move close to it.
When your armies meet, you may want to try to be the first to attack. So try to end your move out of striking range of the enemy army. He cannot attack but most likely will close into your striking range.
Shield with your zone of control (ZOC)
Every unit of level 1 or higher maintains a zone of control (ZOC) covering all 6 neighboring hexes. This means that once an enemy moves into one of the six neighboring tiles, it is forced to halt and its movement phase ends (only enemies with the rare skirmisher ability ignore this).
Because of ZOC, an enemy may not slip between two units which are aligned on a north-south or diagonal line and have exactly 1 or 2 hexes between them. By combining these pairs into a long wall or using them in different directions, you can prevent the enemy from reaching a wounded unit behind. He has to defeat the units imposing the ZOC first. If the enemy can barely reach it, even a single unit may shield a small region behind itself.
Maintain a defensive line
By lining up many units directly adjacent or with at most 1 hex space between them, you can build up a powerful defensive line. Note that, because Wesnoth uses hexes, a east-to-west "line" is not a straight line but a zig-zag curve. The north south line and the diagonals are the "real" lines.
Coming from one side, the enemy may attack any single of your units in the line with only 2 of his units at a time. As a rule of thumb, a healthy unit without particular weakness can withstand an attack from two normal enemy units without getting killed.
Unfortunately, your line often has to bend to form a wedge or to fit the terrain. At these corner points, 3 enemy units may attack. This also happens at the ends of a line if the line is too short. Use units with high hit point on proper terrain or with proper resistances to hold these weak points. These are the most likely to be killed, so use units with no or few experience points (XP) for this purpose.
Lining your troops up also prevents the enemy from surrounding any one of them. For ZOC reasons, a unit with one enemy behind and in front is trapped.
Rotate your troops
When a unit in the front line is heavily damaged you can move him safely behind your defensive line. To hold up the line, you will most likely have to replace him with a reserve, so hold a couple of units in back of the front line. If you have healers, damaged units in the second line will quickly recover.
Note that your units can pass through hexes containing your own troops.
Use the terrain
Try to position your troops so that they are attacking from a hex with high defense against an enemy in a hex with low terrain. Note that different units work better on different terrains. This way, terrain often dictates where you line up your units.
For example, you may position your elves at the end of the forest so that attacking orcs must stand on grassland while your elves enjoy the high forest defenses.
Attacking and choosing your targets
Advancing and attacking is of course the most interesting part of your way to victory. Kill or weaken enemies in your path and move your defensive line forward. This can become tricky as the enemy gets to attack back on his turn.
Often, you will throw several units at a single enemy unit to finish him off, but these were forming your defensive line which is now partly broken. Maybe this doesn't matter because you are out of reach of the next enemy unit. Maybe it does because you only managed to weaken a very strong enemy and next turn, he is going to strike back. Perhaps a Horseman can deliver the killing blow.
Striking first is an advantage because it allows you the choice of which units will face off. Take advantage of enemy weakness: e.g. direct your ranged attacks against foes without ranged weapons. Take advantage of weaknesses like Horsemen's vulnerability to pierce. But remember that they get to attack back on their turn, so you might have weaknesses he may exploit.
For example, Horsemen can hold up the line against Orcish Grunts and Troll Whelps very well because they have some resistances against blade and impact. But your Horseman may quite quickly fall to Orcish Archers and Goblin Spearmen.
It usually pays off if you can definitively kill (or almost kill) the faced unit. If you are unsure of finishing off the enemy in one turn, ensure that your unit can weather the return attacks, or that you're willing to lose that unit. To withstand the enemies strikes next turn, it is often wise to attack with the weapon that deals the least damage to you. So use your ranged weapons if the enemy has no ranged attack. The computers default choice only looks for the most damage you deal out.
Time of Day
Remember that Lawful units like humans fight better at daytime and Chaotic units like orcs or undead fight better at night. Ideally you want to first meet the enemy when you are strong and/or he is weak. When the enemy has its strong time, it often pays off to strengthen your lines and hold a favorable defensive position. When its weak time is about to arise, your advance will push forth.
For example, elves might hold out a forest during a nightly orcish onslaught and advance on sunrise. You may even note that the computer AI actively retreats his orcs during day.
Over the course of a campaign, it is critical that you build up a seasoned force. Later scenarios will assume you have level 2 and 3 units available for recall.
Your units gain most experience points (XP) from killing an enemy unit (8XP per level of the unit killed). As such, it often makes sense to have your higher level units weaken an enemy, but cede the kill to a unit more in need of the XP. Healers in particular are often weak in combat and often need to 'steal' kills in this way to advance levels.
At the beginning (when you probably have no high level units), try to give most kills to a small handful of your units. This will fast-track them to becoming Level 2 units, and they can then shepherd others.
Don't neglect to earn your leader experience. You need to keep him safe, but if you coddle him too much he will be too low level to survive future scenarios anyway.