Typhoid and Hep A? The big way you get these is by drinking the water, and don't drink the fucking water.
Seriously. First of all, you should only drink tap water in your home country (if there). Even in a First World country, you just are not used to the flora in the water unless you grew up in the country.
And, Thailand is not, repeat not, a First World country. The really expensive hotels will tell you the water is filtered, and who knows, maybe it is. Don't drink it anyway.
It is possible to get it from contaminated food, less likely simply because you eat less food. Follow ordinary food-safety rules and you'll be fine:
- Don't eat the outside of food (no apples, no grapes)
- Don't eat ground meat unless you are sure it has been very thoroughly cooked
- Don't eat anywhere you cannot see them cooking. More people are poisoned at fancy hotel restaurants than at road-side stands.
- Don't eat where you see white people eating. Eat where you see lots of locals eating. They are there for a reason.