Hi - All you have to do is bring your pet to the vet. They will take a sample of the stuff in his/her ears to look at under a microscope, flush them out, and give you a liquid to put in the ears to clear it up and maybe an oral antibiotic. Then he/she should be much better :)
Have you taken him/her to the vet? If not, he/she definitely needs to go, and soon!
If left untreated, an ear infection MIGHT heal on its own. However, it might not, and if it keeps getting worse and worse, it could eventually get to the point where it CAN'T be cured, and then the only choices are to either put the dog down to stop it's pain, or do a surgery called an ear canal ablation, where the ear canal is removed and the ear hole is sewn over, leaving the dog deaf and literally with one ear.
Ghilly