It's always best to have a vet check things out to determine the cause of the infection.
In the meantime, you can make your own ear cleaner with a 50/50 blend of vinegar and wintergreen alcohol.
Once you made the mixture, soak a couple cotton balls with it, and insert one under each flap, lower flap, and massage allowing the solution to get down into the canal. Once you've got a good cleaning, take some dry cottonballs and start wiping out the excess and any dirt and debris (& funky black stuff
).
One thing to remember is to never clean them before heading into the vets. We need to see the ear as-is to get a proper diagnosis.
Usually a simple topical medication is sufficient to wipe out the infection, but in some cases a short round of Prednisone (to aid in reducing inflammation) and possibly a round of antibiotics are prescribed.
While ear infections are common and usually come and go with no issues, if left untreated they can cause serious problems resulting in calcification of the inner ear canal and even the ear flap and in extreme cases can result in surgery with permanent hearing loss. So always treat an ear infection as needed!
Just for the record, I've had really good success lately with a product called Zymox. It's an otic enzymatic solution. I believe it's lysozyme, lactoferrin, and lactoperoxidase....if memory serves me correctly (I can look it up if need be though). It's great for chronic otitis due to bacterial and yeast infections. (I have a dog that's "immune" to Otomax and Mometamax at this point after almost 9 years of chronic ear infections....dang allergy dogs!)