Maybe I'm a shopkeeper in ancient Thebes or a potter in ancient Athens or a paper maker in Louyang; I have the same problem that I'm living in this city and as a person living in society I generate trash and I can't just have it pile up in my house so I look like a total slob, and the city can't just have it pile up in the streets waiting for a fire to start, and there's no such thing as a garbage truck. So how do I deal with this giant pile of broken pottery and old food waste and this embarassing collection of poetry I wrote when I was going through my cringey teenager phase?
I can't just have it pile up in my house so I look like a total slob, and the city can't just have it pile up in the streets waiting for a fire to start,
It actually looks like these two strategies are exactly what people did in early phases of sedentary life, as examined in "The Garbage Crisis in prehistory: artefact discard patterns at the Early Natufian site of Wadi Hammeh 27 and the origins of household refuse disposal strategies." "Natufian" is the name ascribed to the culture[s] that left sedentary sites (large villages/proto-cities) in the Levant from about 13,000 to 8,000 years ago - the period which also saw the emergence of cereal grain agriculture, animal domesticates, and all that follows. That research found that when Natufian hunter-gatherers began settling (at least part of the year) in permanent structures, they initially "lacked systematic practices of refuse disposal":
Prodigious quantities of primary refuse, which include by-products of artefact manufacture and animal bone scraps, have been found discarded in these settlements, commingled with cached items of equipment, and even human remains.
Note that when they say "in these settlements" they mean in the buildings themselves, in the floor, not in the interstitial space between buildings. The authors quote Rathje and Murphy's 1992 book, Rubbish!: The Archaeology of Garbage, saying "Throughout most of time human beings disposed of garbage in a very convenient manner: simply by leaving it where it fell."
That paper contrasts the conditions at Wadi Hammeh 27 with nearby sites from later periods, such as a third millennium BCE farming hamlet at Tell el-Hayyat, where "residents... disposed of their household rubbish by tipping it into the narrow lanes that ran between their cramped mudbrick dwellings."
They go on to describe the archaeology in detail and it's pretty interesting, worth skimming at least, but you'll be most interested in the sections at the end, regarding artefact discard patterns before and after the Natufian period, especially their observation that across its span:
houses and villages became more deliberately planned and elaborate, enabling the distinction between interior and exterior space to be more clearly demarcated.
which seems to be a key factor in understanding the process by which refuse disposal habits changed over time. They also note that the transition from simple earthen floors to hard, plastered floors played a role, as you can no longer just trample refuse into the dirt once it forms an impermeable foundation for the interior space.
But the streets were still dirt, so as that bit about Tell el-Hayyat hints at, waste disposal moved out of the home and into the street.
In bigger, later settlements, like the 'bronze age’ cities of the ancient near east, this trend was actually responsible for a significant rise in street level over long periods: the detritus built up and was incorporated into the ground, causing the city to actually grow upwards around the buildings within it. Houses would have to be periodically rebuilt to keep up with the rising firmament (or just suffer from a shrinking distance between the street and the door's threshold), and eventually the oldest and most continuously-populated settlements even became artificial hills, or tells.
Karen Rhea Nemet-Nejat in Daily Life in Ancient Mesopotamia (p. 104-105) says, regarding the 2nd millennium BCE city of Mashkan-shapir in southern Mesopotamia:
The main roads of Mashkan-shapir ran either parallel to canals or at right angles to them, with bridges or ferries to link neighborhoods. The residential areas were connected by a network of streets, and most homes were entered through narrow alleyways and culs-de-sac. The layout of the narrow streets of like a maze. The street surfaces were uneven, in part due to the constant rebuilding of homes on previous foundations that were never leveled, and in part because garbage was dumped into the streets. Dogs and other scavenging animals ate some rubbish, but the rest was dried by the sun and walked on.
We've had two excellent threads on this topic before that you'll want to check out: https://www.reddit.com/r/AskHistorians/comments/2yndym/has_garbage_always_been_a_thing_did_ancient/ and
I especially liked /u/Antiquarianism's answer and shamelessly appropriated one of its sources, but it's well worth reading. Also want to repeat /u/Loknik's assertion that the streets of the city of Troy may have risen as much as five feet per century, because wow.