Eating a diet high in antioxidant-rich foods, including vegetables and fruits, can help prevent graying hair. A person's diet plays a role in preventing the appearance of gray hair. A diet rich in antioxidants can reduce oxidative stress.