To treat an infected hair follicle (folliculitis), keep the area clean, avoid further irritation, and consider topical antibiotics or antifungal treatments as prescribed by a healthcare professional.