To prevent E. coli infections, it is important to maintain good personal hygiene, especially around the genital area. Women should wipe from front to back after using the toilet to prevent the spread of bacteria from the anal region to the urethra. Staying hydrated and urinating frequently can help flush out bacteria from the urinary tract. Sexual practices, such as urinating before and after intercourse, can also reduce the risk of infections.