It is important to know the amount of ear discharge
and how bad is the smell. (Because if it is scanty discharge and fishy smelling then it suggests a different diagnosis). This discharge usually comes out through a perforation (hole ) in the ear drum. It is also important to examine you to determine the type and size of that perforation to decide about treatment for you.
More over one has to find out whether you have any source of infection in your sinuses
. Because if it is there it has to be treated first then ear needs attention.
If you don't have sinus infection
an ear swab be taken for culture and sensitivity test.
After that test result you need to take a course of appropriate antibiotic.
Once the ear discharge stops, if the perforation is small it will close by itself in about 6 weeks and if it is large, surgery may be required to repair the hole in the ear drum.
If it is a marginal or attic perforation a different type of surgery may be required
For your problem you please consult an ENT specialist
you need to consult an ENT specialist urgently.