(The department) was created as the Department of Street Cleaning in 1881, and renamed the Department of Sanitation in 1929. But it was actually made effective for the first time in 1895, in that the people who worked for the department actually collected garbage and swept the streets.
In its early days, the department didn’t really function at all. There are some photographs taken for Harper’s Weekly (above), before and after photos of street corners in New York in 1893 and then in 1895. And the before pictures are pretty astonishing, people were literally shin-high or knee-high in this muck that was a combination of street gunk, horse urine and manure, dead animals, food waste, and furniture crap.
"A Filthy History: When New Yorkers Lived Knee-Deep in Trash" (Collector's Weekly)