Razor burns are ruining a lot of guy's shaves and turning into unwanted razor bumps. Sadly, there is not a single guarantee method to prevent them, but, there are many steps you can be taken to limit them.
Step 1 ~ Moister - shower before your shave to ensure your beard is properly moistened (if unable to wash your face with warm water).
Step 2 ~ Shaving Cream - use a shaving cream appropriate for your skin type and type of hair.
Step 3 ~ Brush - apply the cream with a shaving brush, this will soften & lift hair away from the face resulting in closer shave without tugging at the skin.
Step 4 ~ Razor - do not use a dole razor, this creates drag against the skin (it is often recommended to use double safety razor which doesn't provide excess blade cutting the skin).
Step 5 ~ Method - Go in direction of beard growth with short strokes (shaving against the direction of hair provides a closer shave, however, more razor burns), and end with chin hair to allow the toughest area to soften over time.
Step 6 ~ Post Shave - rinse with warm water, then cold to close the pores followed by part of a clean towel.
Step 7 ~ Moisturize - shaving removes two layers of skin, which is why it's important to moisturize (use one that is not greasy, absorbs quickly and drys without face looking shiny).
These steps are not guaranteed to stop razor bumps, but they will decrease the chance of them after shaving.