To keep from getting a hernia, stay at a healthy weight. Don't lift too heavy. And do exercises that make your middle muscles strong. This lowers your chance of having a hernia.