Ear infections are very common in young children and often follow a cold. Many are caused by viruses and settle on their own within a couple of days, so the main focus is comfort: weight-appropriate paracetamol or ibuprofen for pain, plenty of fluids, and rest. A warm (not hot) compress against the ear may also soothe.
Antibiotics are not always needed and are decided by a doctor, who may recommend a short wait-and-see period before prescribing, depending on your child's age and how unwell they are. Do not put cotton buds, oils, or eardrops into the ear unless a clinician advises it.
See a doctor if your child is under 2 with ear pain in both ears, has fluid or pus draining from the ear, has a high fever that will not settle, has severe or worsening pain, or is not improving after about two to three days. Swelling, redness, or pain behind the ear needs prompt assessment.