What our ancient ancestors in the Stone age did with their waste is subject to much conjecture. Archaeology does not provide us with any answers until we get to the Iron age where there appears to be an attempt at some ancient sites to have a separate area away from the main settlement.
The Indus Valley Civilisation from 2600 BCE onwards is the first to try by tapping into the nearby Indus river. Earthenware clay pipes and troughs were used to channel water but it was the Minoan Civilization of Crete with its capital at Knossos that has the first real evidence of a latrine, communal toilet that served to remove waste. This dates from 1,380 BCE.
The other Greek city states soon follow suit, as do the Egyptians. The Roman’s truly perfect the skill recognising the need for public health and cleanliness. They created communal toilets and baths where the waste and waste water are all removed.
However from the Dark Ages to the late Victorian Age, drainage and sewerage became virtually non existent. An example of one of the few drainage systems can be seen in Wells in Somerset where it flowed through the streets. This was better than nothing.
With the coming of typhus and Cholera we soon learnt that drains and Drain Lining to help repair our drains was a necessity.