There are various types of eye infections including pink eye, fungal keratitis, acanthamoeba keratitis, trachoma, endophthalmitis and viral keratitis. All these infections are usually caused by bacteria or fungi or viruses. So it is hard to tell how to treat it perfectly. Once you suspect an eye infection, you should visit your eye doctor and have an eye exam to find out which eye infection you get. Nowadays, the most treatment for the bacteria eye infection is by prescription antibiotic eye drops or ointments and compresses. If you have viral eye infection, you can use antiviral eye drops. Depending on the cause of your eye infection, your doctor will give you the suitable medications.