Bali belly is real and mostly avoidable, and the advice people give each other online is usually wrong. Expensive restaurants are not automatically safer. A warung that feeds forty construction workers at noon turns over its food every hour. That is what you want.
The water question
Do not drink from the tap, and that includes brushing if you are careful. Bottled or filtered water only. Ice in restaurants and warungs is made industrially with clean water and is fine, you can see it, it has a hole through the middle. Ice that is crushed and loose from an unmarked bag at a roadside stall is the one to skip.
Fruit that you peel yourself is safe. Pre-cut fruit that has been sitting warm is not.
What to actually eat
Babi guling, suckling pig, is the dish Bali is known for and it is a morning food. The good places sell out by early afternoon and close. If a place serves it at eight in the evening, it has been sitting there.
Nasi campur is the everyday plate, rice with a handful of small dishes, and every warung makes it differently. Sate lilit is fish minced with coconut and lemongrass on a stick. Bebek betutu, the slow cooked duck, usually needs ordering a day ahead.
Vegetarians eat very well here, but say it clearly, because there is often shrimp paste in the sambal and chicken stock in the soup.
Spice
Sambal is served on the side for a reason. Take a little. Balinese sambal matah, the raw one with shallot and lemongrass, is the best thing on the table and it will surprise you.


