I'm prone to getting sick so when I'm traveling, that's my main worry :(
A. Be lucky
Only drink non-tap water- we would buy lots of plastic gallon jugs at a time.
Only eat cooked vegetables and wash any fruits with non-tap- but this was Central Asia, so veggies and fruits aren't that common anyway, especially Mongolia. (except watermelons- they're everywhere)
Have your doctor proscribe anti-diarrheal pills and maybe some antibiotics as well.
I'm not prone to getting sick. On the Appalachian Trail, I only filtered water that was cloudy or still water, otherwise I just filled up my water bottles. This is NOT recommended, but it works for me.
I can't remember getting sick on the rally, maybe an upset stomach once or twice, but nothing really serious. We ate at some extremely sketchy spots and none of us suffered- maybe we were just lucky?