You should get an anitfungal cream or ointment and apply that to its ears. A vet might also prescribe an oral antifungal in addition to the cream to help with the infection.
One temporarily effective treatment is a topical ointment called Panalog. As an alternative, a mild solution of peroxide and water applied using a cotton swab be placed inside the dog's ear.