This isn't really something that I can give example for how to write. War is vast and varying. However, I do recommend that anybody interested in adding in a war reads the Iliad and studies the portrayal of war in that. I wouldn't recommend the Aeneid because I wasn't very impressed with the portrayal of war there, although I still love the Aeneid very much (it still isn't a patch on the Iliad, though). Alternatively, you could read Thucydides' account of the war between Sparta and Athens during the three hundreds BC.
There are so many things to consider when putting in a war. For most people, the war will be the central conflict or a stimulus for the central conflict in a story. This means it's got to be GOOD. It's like an antagonist: you cannot have a weak portrayal of war.
Various things to consider when it comes to war:
Oh, man, politics. THIS is the one that people tend to either stuff up or forget, but sadly, it's the most important one, and it's also the one that annoys me the most if it's not done properly.
Sure, most people hate politics/don't want to think about it/find it extremely boring, and so it's left out or glossed over.
DON'T. Have you ever read about a war in this world that is lacking politics of some sort?
I will be one of the first people to stick my hand up and say that I find politics boring. It just doesn't interest me (apart from when Belgium gets a government). There are some people who like politics and will lap everything up. This means that you have to make the politics accessible to all types of readers.
The key to this is to remember how complex politics can be. And above all, to remember that things happen for more than one reason, ESPECIALLY when it comes to war. Maybe this is just because I'm not interested in politics, but I can't currently think of a single war that's happened for only one reason. In history class, we used to divide the reasons up into long term causes, short term causes, and trigger causes. The trigger causes were the simple ones that sparked the war, but the thing about a trigger cause is that it could be swapped for another trigger and the war could happen from that one. It requires a base of other reasons, which are the long and short term causes of the war.
Anyway. That might be going into it a bit too much, but yeah. Politics surrounding war, during war, and after war is never easy. It's highly unrealistic for things to be easy or nonexistent when it comes to politics in a story world.
#2. General stuff about armies.
This is my second major gripe. I've just realised that this post is probably going to seem like one massive rant.
To be honest, I kind of can't think of enough subheadings for each section. Anyway.
BE REALISTIC with what your army can do. And for the love of all that sparkles, remember that it's going to need a supply train unless it's set after the advent of aircraft.
TIMINGS. Your army simply cannot get from A to B in half a day and be ready to fight. They are not robots. Marching tires people. Also, I see from fantasy novels that many people seem to forgot/miscalculate how far somebody can travel in a day without a car.
ALTERED DYNAMICS BETWEEN THE TROOPS. Mostly, this tends to be done at the black and white ends of the spectrum: there are some people who like the army/war, some who don't but are loyal to their leaders, and those who complain about it. There needs to be more grey in there than that.
FEAR. Not that you want to turn your characters into cowards, but -- especially when involving modern day warfare -- war is traumatising. I know of full grown men who've been out at the front and who just refuse to talk about what went on there because it was so horrible. It is fine for your characters to feel afraid and wonder if they'll be alive tomorrow. Even the bravest of soldiers are scared sometimes.
ESPIONAGE, DECEIT AND INTRIGUE. C'mon, you can have so much fun with this. Just... remember that the good guys are going to break the rules a little when it comes to this as well as the bad guys. Sure, the good guys might not use torture or something when the bad guys do, but espionage etc. is a shadowy game. You can't really play fair when it comes to this. Having a completely honest character in this kind of area is... well, I'm not saying that all spies are deceitful liars, but to some extent that's a part of their job, isn't it?
TURNCOATS AND TRAITORS. There may not be many of these, and they don't even have to be important, but there are always some people who switch sides.
DESERTERS. This happens too. Especially when an army begins to realise that they're going to lose. They get demoralised and decide to run.
FOOD. Make sure that your army is fed. Remember the supply train?
TACTICS, LEADERSHIP AND DEPLOYMENT. This is very important. To some extent, it's the easiest part to do because you can kind of do whatever. However, in ancient times (meaning this applies to high fantasy), things like deployment were even more crucial than they are now. In books, most people don't seem to get past the point of the high point being the advantage or boxing people in with cliffs and forests etc. Yes, that's true, but there are more things to it, such how hard the ground is, etc.
WEATHER. You knew it was coming. Weather is also going to affect the possibility of a fight. Especially rain, fog and storms.
FUNDS. Make sure that there's enough money to run things. Or show that you know about the finance side of things by putting the army in a financial pinch. Wars are extremely expensive.
REACTIONS OF THE LOCALS TO THE ARMY. Do whatever you want with this one, really, but make sure that they're there and that there's a variety.
#3. Getting the armies to meet.
Technically, this belongs in the above, but I'm putting it in a subheading of its own. This is another one people seem to gloss over. Fine if you have magic or radar etc., but it's always worth giving a little thought as to how armies used to meet way back when when the information system wasn't instantaneous.
Sure, there were scouts and whatnot, but if you were marching through a foreign country, the scouts always got killed and you wanted to know where the enemy was?
You waited until it was dark, hoped there were clouds, and then looked for light pollution.
I'm not even joking. Enemy armies used to use this as a way to attract each other's attention so that they could fight. The light from the camp fires used to reflect off the clouds, causing light pollution which enabled people to see where you were, since until the advent of electricity, there was never that much light pollution from cities.
On a similar note, to avoid another army, you lit as few camp fires as possible so that you couldn't give your position away by light pollution. Neat, huh?
What can I say about these kind of conditions? Starving, running out of water, ease of spread of disease, people trying to escape... oh, and the fact that it'll take more than a few days for these kind of conditions to impact in a siege. It'll take months, possibly years.
#5. Medical stuff
Always worth researching what you can do with this. And always worth making sure that you're consistent with your character's injuries and what they can and can't do after them. But it's worth looking up the kind of medical remedies they had before the sort of first aid we use now was invented -- plants with medicinal properties are fascinating. You know that there was a type of moss that used to be used to staunch wounds?
#6. Pillaging and looting is always going to happen, even if it's not by the good side.
#7. Clearing up afterwards is just as important and just as delicate a matter as the reason the war sparked in the first place -- as is the politics involving this.
#8. Not everybody is going to behave respectably.
I think that's totally self-explanatory. You'll get a whole range of personalities in an army. Some people will behave; others won't.
#9. Compromises and deals.
Honestly, I recommend just looking through history for ideas on this. The most unlikely people will team up in war, and they won't necessarily intend to honour their pacts.
Gah. I know that there was a lot more I wanted to do with this. I might come back and add at some point, but I can't remember what the other things I wanted to mention were.
But yeah. If you're going to involve war, make sure that it's realistic. WAR IS NOT SIMPLE. Don't try to make it simple. And above all, don't forget the politics.