My tips would be:
* Avoid salads
* Avoid street vendors unless you see it cooked right in front of you
* Minimise meat intake. I go 80% vegetarian
* No seafood unless by the sea. There is no network of refrigerated distribution in India making prawns 500 miles from the sea very risky
* Only drink bottled water, and only with the seal intact
* Wash your hands frequently and use anti-bacterial handwash
I'm happy to risk fruit (mango and pineapple especially) and drink a lassi daily which seems to help.
Doing that I've managed 20+ trips (some weeks long) and been ill only a couple of times. Living there is a different deal. Friends and colleagues say that you will - inevitably - get badly sick at some point.