help?

so i was having pain around my clit after masturbating. i decided to take a look today, and at first i thought it was a pimple but at closer inspection i saw white buildup? around my clit and took a qtip and removed it. the pain is now gone. was that a bacterial infection or what?