Discharge of pus is often a result of some infection. Though it might be tempting to treat with antibiotics, the problem will continue until the underlying reason is addressed.
Anal fistula often presents initially as an abscess - a painful collection of pus. This pain is often constant and not associated with bowel movement. It can rupture on it's own or sometimes needs surgical drainage for relief from infection.