Modern plumbing developed mostly by trial and error. Throwing buckets of excrement on the passersby below often led to the spread of illness and a lot of punch ups.
Toilets were developed in the 1840s, but with out piping and sewer, you still had to toss the stuff. Things got pretty stinky in London in the 1850s, and since the toilet was already hanging about, sewers were put in.
Many instances of suction lock were recorded at the time, with children being especially susceptible. After seeing Auntie being freed from the toilet bowl, the young’uns went to great lengths to get their friends stuck. Described at the time a “like shooting fish in a barrel”, this led to the development of the toilet seat.
The kitchen sink came next, and this was equipped with a hand pump for the household water. This thing doubled as a bath tub. They were huge, but so was Auntie. Hopefully they did the dishes first.
The lavatory (bathroom sink) took a long time to develop. This should not be a surprise as the pioneers of plumbing would think nothing of washing their hands in the toilet.