Is the infection around the ear tag? If so it is best to remove the tag until the infection clears, then replace. Another possibility is inflammation caused by contact with a poisonous plant, or a thorn or other scratch.
You will need to clean the ear and get rid of the pus/exudate. Batheing with salty water helps, then spraying with blue Terramycin (or similar) spray, and repeat until the problem has cleared.