The first step is prevention. As the plane prepares to take off, chew gum. If your hearing becomes muffled and you begin to feel slight discomfort or pain during the ascent, force yourself to yawn and swallow. This will activate the muscles that open the eustachian tube (responsible for regulating air pressure in your ear) and allow air to escape and become balanced with the air pressure in the plane's cabin.
As the plane descends, air will need to enter your eustachian tube to re-balance the pressure. This is a little more difficult, and that is why more people experience airplane ear during the landing. Use all of the same techniques that you did on the ascent; chew gum, swallow and yawn.
Try to avoid being asleep during the take-off or landing, as this makes you more prone to have ear pressure problems. Try to avoid flying when you have a cold, sinus/ear infection, or hay fever. The clogged sinuses will leave you more prone to suffering from airplane ear. Infants and toddlers have small eustachian tubes and are therefore more likely to suffer from airplane ear. Nurse or give the child a bottle during take-off and landing to help them clear their ears. Also, get them to imitate your yawns in order to help open their eustachian tubes.
If your airplane ear lasts for more than a few hours and you experience severe pain, hearing loss, ringing, bleeding, vertigo and/or vomiting, you will need to see a doctor.
In many cases, the affliction will go away as your ear pressure slowly regulates to being on the ground.