When you shave, it's important to use proper shaving techniques. Shave in the direction your hairs are growing in, and not against the grain. You may make a second pass over the skin, but do it gently, and don't push down too hard against the skin. Again, it's not in your interest to get a super-close shave. As such, don't pull your skin taut when shaving a particular area. When you release the skin, the hairs you just cut will recede beneath the follicle opening and be more likely to grow back into the skin or sideways through the follicle itself.
People susceptible to shaving rash should shave with a single-blade razor. Despite the marketing hype, you don't want an especially close shave. As such, you should avoid shaving systems that cut the hair beneath the surface of the skin by lifting or pulling the hair as it's being cut. Hairs cut below the opening of the follicle can easily become ingrown.
If left unchecked, shaving rash can result in discoloration that can last for months, and in severe cases, it may cause permanent scarring. But as painful and unsightly as shaving rash can be, it's also pretty easy to prevent, so long as you're willing to adjust your shaving routine. The severity of your shaving rash may determine how extreme those adjustments need to be.
Others may have better luck getting rid of shaving rash by using an electric razor. Electric razors, even at their best, usually don't create as close a shave as regular razors, which is favorable when it comes to avoiding shaving rash. You can also adjust how close a shave your electric razor gives you -- this works the same way lawn mowers work, allowing you to adjust the height of the grass (or hair) that's left when you're done. While a five-o'clock shadow doesn't look as fresh or clean-cut as a perfectly smooth shave (especially if that shadow is on your legs), cutting the hairs slightly off the skin allows them to grow out naturally without curling back and becoming ingrown.
Cleanliness may or may not be next to godliness, but it'll get you close enough when it comes to shaving, as we'll learn next.