Ditto as Dr Chin has mentioned, but another piece of advice too:
1. Change your blades regularly as recommended by the razor brands guidelines. Saving a bit of money is not worth the recurrent folliculitis.
2. Use shavers with fewer blades. The media today advertises newer shavers with up to 5 blades, and this increasing number of blades merely increases additional trauma to your skin. 1 to 2 blades are typically sufficient.
3. Prep your hair prior to shaving by warming them up - you can either apply a warm towel over it for several minutes or shave immediately after a hot shower. This reduces the resistance of shaving and reduces the friction that can cause nicks in the skin.
I suffered such folliculitis for many years and now personally prefer the use of single blade safety razor shavers, and use each side of the safety razor only twice before changing to a new blade. Fewer nicks, less trauma, less folliculitis.