This is a complicated question with a multitude of choices.
Are you asking for a two hour walk or an overnight trip?
If just a short 2-5 mile hike, a nice daybag can easily carry a quart of water and snacks, jacket etc. For hikes in cool weather K & C often carry hot tea (and snacks) for break time.
For an overnight backpack where more water is needed than can be carried, I use a gravity filter or pump. There are some very small, light devices out these days.
I personally dislike chemical treatments because of taste. And you have to be really careful with temps and contact time.
There are little "straw" like filters out now so you can suck water from small streams.
There are battery powered UV wands. You can drink "safe" water with dead bugs floating around!
----KenM
https://www.rei.com/search?q=water+filters
click on "chosing a water filter" at the top = more than you want to know.