An ingrown hair infection, or folliculitis, occurs when hair follicles become infected with fungus or bacteria. There are several potential causes of infected ingrown hairs.ShavingShaving is the most common cause of inflamed ingrown hairs. Using a dull blade, especially one with rust, or an electric razor can cause ingrown hairs that become infected. Both shaving means do not always properly remove a get rid of hairs hair from the root and might contain bacteria,
Blocked PoresUsing petroleum-based ingrown hairs shaving creams and oils clogs your hair follicles, which promotes ingrown hairs and infections.
Excessive SweatingSweating profusely and not immediately showering causes clogged pores that can cause an ingrown hair to become infected.
Pools and Hot TubsPools and hot tubs that are not properly treated with chlorine are breeding grounds for bacteria and fungus that can infect ingrown hairs.
Tight ClothingFriction from tight clothing prohibits pores from breathing and can cause infections.
Source:Mayo Clinic: Folliculitis