Mist, steam. Ear pain isn't always an infection. The most common reason is nasal congestion. Try treating with mist or steam, with mentholatum. Give pain medication, such as Acetaminophen or ibuprofen. Warm compresses are helpful, but can be dangerous. Instead, use a cottonball coated with mentholatum. Ear infections seldom require treatment in the middle of the night.
See pediatrician/ENT. Young children are especially prone to ear infection so see a doctor to find out.