Preventing rust in bolt heads
Where possible, replace with stainless fasteners. Things like water bottle bracket bolts are readily available in stainless at a good hardware store.

But most fasteners on a good quality bike are stainless to begin with, so it may be that you're not seeing "rust" per se but rather a sort of corrosion that can form on stainless.