how to avoid ingrown hairs?

i get ingrown hair very bad & i need to know a ways to avoid them after shaving or using nair.