Sushruta of India recommended to boil and heat water under the sun and filtering with gravel and charcoal prior to drinking.
Throughout most of human history the primary means of acquiring untainted water was to avoid the problem and bring in water from an outside source that did not require treatment.