It is essential to stay hydrated on the trail. Which means making sure you always have plenty of safe / clean water, and that you're actually drinking it.
Where do you get the water?
There aren't drinking fountains along the trail. Well, actually, there are a couple, but usually water needs to be gathered and carried, and not all water sources are created equal. If you want water that tastes / smells good you might opt to, for example, carry extra to bypass a moldy pond.
In the Cascades and Sierras there are often multiple streams per mile. You get tired of crossing so many streams (and regret ever thinking that the second you hit the desert). The water is clean and delicious, and almost certainly safe to drink without filtering (although I always filtered because I didn't think it was worth the gamble).
Through Oregon and northern California there is plenty of water, but it's not the amazing snow melt / spring water of the mountains. Most of it is very good, but occasionally you drink water that tastes like a swamp.
South of the Sierras there are long stretches with almost no natural water. During these sections I drank some of the nastiest water I've ever encountered. Some was so bad that I'd carry it for emergency, but I'd wind up not drinking it and dumping it when I found something more palatable.
The other source of water is water caches. These come in the form of large water tanks, cisterns, guzzlers, and just piles of gallon jugs. These caches are maintained by PCT trail angles and are a literal life saver. There were stretches that I could not have completed if it wasn't for a well placed water cache.
How do you clean and carry it?
It's pretty obvious what the most popular water storage / purification strategy is within minutes of getting on trail. I also happen to think it's the perfect choice.
Sawyer Squeeze
This filter is perfect for through hiking. It is incredibly small, light, and simple. It can be attached directly to the mouth of a standard disposable water bottle or used with the included water bladders and filtered into whatever container you'd like.
Smart Water Bottle
As a general rule I don't do bottled water. It's incredibly wasteful, and the bottled water companies are basically the devil. So, I originally bought 3 Nalgene containers. However, I jumped on the Smart Water bottle band wagon before starting the trail because they are considerably lighter, less bulky, and can be replaced at basically any store or gas station if needed.
The smart water bottles are extremely durable and the two I started with made it all the way to the end.
What about the cold / freezing?
Through the Sierras I'd often wake up with frozen water. Usually it was just a bit chunky, but a couple times my water was frozen solid. This was never really much of a problem as the mornings were so cold that I didn't want to drink anyways. Since water was so abundant I could just get more or just wait until around noon for the water to thaw.
One other issue with the cold is that if the filter freezes it will stop working. The scariest part is that there is no warning or indication. The water in the filter freezes (expands) ruining the filter and the filter just silently stops being effective. To prevent this I slept with my filter in my pocket every night that it was anywhere near freezing. I'd pre-filter a liter of water before bed incase I got thirsty in the night or in the morning before it got above freezing. Then I'd put the Sawyer in a zip lock in my pocket and I usually wouldn't take it back out until around lunch time.
How much water do you carry?
I started the trail with two 1 liter smart water bottles and two 64 Oz Sawyer bladders. For a total capacity of 195 Oz (5.7 liters). Early on I was very paranoid about water and always carried 2 liters (2 full smart water bottles). If I crossed a stream I'd top off. I only used the bladders for gathering "dirty" water. I'd usually fill one 64 Oz bag at the last stream before camp just to make sure I had plenty for cooking, the night, and the start of the next day.
Pretty quickly I realized there is water everywhere and running low/out isn't that scary. Once that sunk in I regularly carried less than a liter of water. I also tossed the Sawyer bladders and started just gathering water with the smart water bottles directly and took advantage of the Sawyers ability to be used like a sports bottle filtering as I drank. I always kept one bottle for clean (pre-filtered) water. I simply pulled the label off of all the bottles but one so I'd remember which one was clean water.
The first time water gets scarce is between Bernie Mountain and Lassen Volcanic National Park. There is about 40 mile without natural water. There is a water tank half way through that was full when I got there, but to be safe I bought a 3rd Smart Water bottle at Bernie Mountain Guest Ranch and left there with 3 liters. Which was lucky because my ankle started killing me about 3 miles before the water cache so I had to camp early. Luckily, I had enough water and the early camping was a great choice because my ankle felt fine in the morning with a little rest. It was a good reminder that carrying minimal water / supplies is great for when things go right, but if something unexpected happens it can leave you in a tough situation.
Outside of that stretch water is pretty abundant until after the Sierras so I carried 3 bottles, but really only ever used the two "dirty" bottles during the day and I'd filter a liter into the clean bottle before bed so it was easy to drink during the night.
Right after the Sierras water gets scarce quick. After Mt Whitney the streams started becoming much less common and they often had a mildew smell/taste. I purchase a 4th 1 liter smartwater bottle when I hit Kennedy Meadows (south).
Being a south bounder means everything is even dryer than what the northbounders face. There are very few streams and some of the water caches aren't maintained anymore. So, for the last 600 miles of the trail I regularly carried 4 liters of water. I heard some other hikers talk about carrying 5 or 6 liters, but I never found it necessary. Even 4 liters was usually overkill, but I figured it was better to be safe and a couple times I hit unexpectedly dry streams or really gross water sources and was grateful to have the extra water.
How did you stay hydrated?
Staying hydrated For the most part this took care of itself. If I was thirsty I drank some water. To help make sure I was getting enough water I'd often "camel up" at water sources. Basically I'd drink a liter or so whenever I gathered water. Additionally, I always filtered a liter of water before bed and would generally try to finish it before hitting the trail the next morning.