Pus formation is due to presence of infection. you may have infection either in gums or tooth. you can send picture or x-ray of that area and get the consultation done by dentist. a dentist will prescribe antibiotic for that and will suggest the treatment. root canal treatment or extraction advisable in such cases.