We have no idea how lucky we are to have clean water available in (it seems) unlimited quantities just by turning on a tap. All the water that comes into an ordinary home is drinking water. We drink water, make coffee and tea with water, fine, but we also shower with drinking water, wash the car with drinking water, flush with drinking water, water the plants with drinking water…. Imagine a whole series of plastic bottles flying by next time you're in the shower.
This is a development just of the last century. And it may not last, because we're using up available water. California, under the pressure of a burgeoning population, heavily irrigated farmland, and a major and continuing drought, is having to figure out how to save and use "gray water," the water from, say, washing dishes, which is perfectly good for flushing or watering plants.
People in the Middle Ages never had our free and easy attitude toward water. They were, of course, just as concerned as anybody about water-borne illness, which is why you could get someone in very serious trouble by accusing them of poisoning the well. You don't need to know about germs to know that there can be impurities in the water that will make you sick.
In much of western Europe, cities often relied on Roman aqueducts. The ancient Romans had had the same concerns about getting pure water, so they had built aqueducts to carry water often many miles from mountains down to town. They had also constructed big sewers in the city of Rome, most notably the cloaca maxima, which is still (partially) in use today.
But if one were out in the country or didn't have an aqueduct, wells were the only option. They were of course hand-dug; wells today are drilled. In dry areas and in places (like mountaintop castles) where it was impossible to have a good well, they collected rainwater. A castle would have plenty of water stored for a long siege; it was even more important than food.
Peasant houses and town houses had privies out back. This became a problem in the post-medieval period, when all the empty spaces between houses of a medieval city were filled in. Then houses had cesspits in the basement, that had to be cleaned out periodically. Medieval castles had "inside toilets," you might say, privies set in the outer walls, sometimes opening on air, but usually with drains to carry things away. It was sometimes possible to capture a castle by crawling up through the drains.
All medieval cities were located on a body of water. Clean (or fairly clean) water would be taken out on the upstream side of town, and noxious trades (like leather tanning) would be located on the downstream side, where the water would carry away the noxious products. With luck, the river would have cleaned itself by the time it flowed down to the next town. Now, in fact, a running stream going over sand and gravel can clean itself, sort of, but only of organics, not of modern chemicals or heavy metals (much less the coal slag of the nineteenth century that made England's rivers black).
Even aside from drinking and washing, water was needed to run the watermills (the medieval version of factories) and to produce fish. And of course, as all farmers know, the crops won't grow without water. (Click here for more on medieval use of rain.)