Someone would probably engineer a new sanitation machine or system that doesn't need as much human labor or exposure with unsanitary stuff as an interesting hobby. But yeah, people would have to build communities and the sense of community, and come to a consensus on how that community would want to divide labor; i.e. the community could vote to take turns doing undesirable jobs, or allow people to in undesirable jobs to work less hours or something.
Now that I think of it, things could be radically different if everyone is exposed to the undesirable work. Communities would probably opt for composting and less or compostable packaging in lieu of having to do a lot of trash work. They'd probably opt to eat less meat rather than working at a slaughterhouse.