It’s not just a matter of carrying enough water — you need access to more if you run out.
That means two things: a) letting your water supply determine your hike length (turning back when it’s half-gone, for example); and b) having a plan for running dry.
There’s a whole industry built around keeping you hydrated. Make use of it, and shop wisely. Hydration bladders are over-rated — prone to leakage and unable to tell you how much you’ve got left. Filters and chemical purifiers and plentiful and good to have if you don’t mind the extra weight.
Availability of water is as integral to a hike plan as distance, elevation gain and altitude. Without it you’re going nowhere. Even if you’re carrying plenty, keep an eye out for more. Make mental notes of spigots at trail heads and log all streams and springs in the backcountry (keeping in mind they do run dry in the summer).
Water should never be far from your mind … but you don’t want to be in a situation where it’s all you think about, though, because that usually means you’re all out.