Anyone can get an E. coli infection, but certain groups are more at risk. These include young children, the elderly, pregnant women, and individuals with weakened immune systems. Consuming high-risk foods such as undercooked ground beef and unpasteurized dairy products also increases the risk.