UV light of the proper size for flow will kill bacteria. It's legal in sanitizing water used in dairies. I use to dairy and raise horses and cattle.
Reverse Osmosis uses pressure to push water molecules thru a membrane. Things bigger than a water molecule won't go thru and are flushed away. But it's not like filtering water. Only about 1/4 to 1/3 of the water goes thru, the rest is used to flush and carry away the rejected contaminates. You also use filters before the membrane. Lots of info on line. I'm retired and live on a big boat. I use RO to make fresh water from salt or unknown fresh into safe fresh. Membranes are rated at 77°F. Colder water, less output. Many RO systems on eBay. I built my own, 40 gph from salt water, much more from fresh.
If you live in a rural area that didn't have mining, no feedlots, etc., spring water and small creek water may be drinkable with filtering and sanitizing with a UV light or some added sanitizer, but get it tested. Rural meaning not many people nearby, no cities over the hill, no interstate hwy putting pollutants in the air, water is either coming out of the ground where it's collected or a flowing stream you can trace to it's source. I used spring water on the dairy.