Some children, who have been flying since infancy, are pros and handle air travel with ease. For others, though, it’s stressful. Confining a young child to a cramped seat for a few hours is bad enough. Toss in a bunch of strangers and no way for anyone to escape, and two hours can feel like 12, for everyone within earshot.

An incident earlier this month where a man slapped a screaming toddler on a flight from Minneapolis to Atlanta is extreme, but it shows how tense things can get in the close quarters of an airplane.

As a mom, I feel for the parents of those screaming children. Who hasn’t been there? There is nothing worse than enduring hateful stares from other grown-ups while you are desperately trying to pacify your child.

Here are some suggestions from parenting and travel experts on how to know when your child is ready to take flight, and how to keep him or her calm at 30,000 feet.

* Three months is the magic age. Most babies are ready to fly around the time they are 3 months old, said Rebecca Michals, global community manager for Babies that age do need a lot of gear when traveling, she said, but many will sleep through a flight if it is at night or during their nap time. Michals said some international carriers have bassinets for babies to use during flights.

* Take practice runs in the car. If you are planning a trip with an older baby or toddler, try taking some road trips to build up his ability to be confined for several hours, said Heather Hunter, public relations manager at AAA.

* Ease ear pain during takeoff and landing. Offer infants a bottle or pacifier, and older children a snack or drink, to fend off ear pain when changing altitudes, Michals said. John and Sherry Petersik, authors of the blog Young House Love , wrote about how they gave their daughter lollipops to help if her ears popped when they flew from Richmond to Hawaii last year.

* Bring too much of everything. Take as much formula, breast milk, snack food or juice as you think you will need, said Hunter. Then bring extras in case you are delayed. Michals suggests bringing one diaper for every hour that you will be in transit, plus a few extra. She also recommends putting several complete outfits in plastic bags in your carry-on, so you’re not digging around for tiny socks when you need to change your child’s clothes.

* Stock up on entertainment and treats. A bag of new toys, or toys that have been hidden for a few weeks so they will seem new, can help get you through a flight. Bring them out one at a time, Michals said, to keep your child’s interest. Keep a stash of favorite snacks and finger foods to stave off boredom and hunger. And a portable DVD player or tablet with games, apps or movies and comfortable headphones can help occupy an active toddler.

*Offer earplugs. If all of your attempts to keep your child happy and occupied during a flight fail, Michals said, some parents like to have a few sets of inexpensive earplugs to pass out to people sitting around them. The simple gesture acknowledges that your child is being disruptive and may ease tension between you and your fellow passengers.

“Most people are understanding if they can see you are trying to help your upset child,” Michals said. “I just remind other moms that anyone nearby who has traveled with their own children won’t be annoyed. They’re very sympathetic.”