Constipation contributes to hemorrhoids. Drink plenty of fluids and eat foods with a lot of fiber and whole grains to prevent constipation. Staying active also prevents constipation.