Preparing yourself and your kids ahead of time is really important. Think through what you will need to pack in your hand-luggage, and get your supplies together (medications for example). Talk to your kids about the trip. Tell them what will happen before you get on the plane and on board. Read and talk about airplanes and airports. Also talk to your kids about how to behave during your trip: I find that it's a lot easier for my kids (5 and 9 years old) to do what's expected if we've discussed it ahead of time.
Ask the airline about cots for your baby if you're traveling with an infant, and order kids' meals (or any other special meals) for older kids and yourself. Prepare yourself by thinking through what might happen during your trip (flight delays, tantrums, diaper disasters, and so on) and how you can deal with it. You can never prepare for everything, but just thinking about your trip a little bit will make you more able to deal with both the expected and unexpected.
Arrive early at the airport so you don't have to stress too much to get to your gate on time. Be prepared for lineups at check-in and security. Also book any connecting flights so that you have enough time between flights and won't have to rush with your (possibly tired and reluctant) kids through unfamiliar airports.
If you're traveling abroad, you might have to go through security and immigration before catching a connecting flight, and that can add a lot to the transfer time between flights.
If your kids start melting down, or if they have a tantrum, or if they are doing things they shouldn't on the flight, try to stay calm and deal with it as best you can. Staying calm can be really hard to do, but I find that it's a lot easier to calm my kids down if I manage to maintain at least some calm myself.
I always try to remember that my kids might be scared, uncomfortable, and anxious, and that the strange environment of airplanes and airports probably isn't helping with that. Try to talk your kids, hold them, comfort them, and redirect their attention (toys, games, snacks, and movies can help). Eventually it will be OK, and you will arrive at your destination.
Sometimes it seems my kids are programmed to need bathroom breaks when it's most difficult to get to the bathroom. For example when we're in a long security line-up, right after the meal is served on board (tray tables down, loaded with food and drinks), or when we're waiting to disembark the plane and the crush of people makes it hard to move at all.
To help prevent emergencies, I try to get my kids into the bathroom right before and after a flight, and if possible before we get into any long line-ups. During the flight I try to get them into the bathroom before the meal is served, and I'll ask them if they need to go if there seems to be less of a queue for the washrooms. I often feel like obsess over washrooms when we're flying, but when it comes to this, it definitely helps to plan ahead!
Tired, hungry and thirsty kids are more likely to melt down, cry, whine or be miserable in general. On long flights it's sometimes hard for kids to eat and drink enough, because they're in a strange environment with strange food, strange people, and a lot of strange things going on. Bringing familiar snacks along is a good way to make sure your children will at least have something to eat, even if they don't like anything on the plane. I also try to make sure my kids drink enough (but preferably not so much that we spend every 5 minutes in the airplane bathroom!), and that they relax and sleep as much as possible.
Whenever my kids start really going haywire on a trip, it's usually because they're really tired, hungry or thirsty. Snacks, some water and some sleep (or even just taking it easy by watching a movie or staring out at the airplanes at the airport) can help.
All images thanks to Online-Sign.com.