Recurrent herpes

i have had two pretty sore outbreaks in the space of two months and am wondering why i keep getting them all of a sudden. i'm generally ok and usually only have mild ones every once in a while but these last two have hurt like a b***h :/ i'm paranoid about hiv and read that herpes outbreaks can be linked to hiv but i tested negative for it and so did my partner. what can i do to prevent outbreaks?