If a piercing gets infected, leave the piercing in, otherwise the hole will close up, leaving no way for the infection to escape, which will only cause more problems. As long as the stud keeps the hole open, it leaves space for it to breathe and eventually clear up.