you don't
It would be decided communally just like it used to.
In England for example, before enclosures you had communal lands meant for the upkeep of peasants called the "commons." Theoretically you could do anything you wanted with whatever you found there. Debris for firewood, grasses for threshing, game for eating, etc.
So, in theory, a peasant could spend all day out in the commons killing every animal he saw. The constraints of material reality still effect him though. He can only eat so much roebuck, so many hares, quail, whatever. After a certain point it just becomes wasteful.
At the time he probably would have just gotten his ass kicked and hopefully lesson learned. If he violated an actual legal code, he'd be dragged before his local magistrate/constable/whatever, who usually happened to be the feudal lord or whoever owned the district the affected peasants and the commons were in. Usually their fate would depend on tradition–what punishments had been meted out in the past for similar infractions–and the will of the judge.
But things have advanced considerably since then. Alternate solutions are possible and vary from leftist to leftist, but I think in general the ideal is for those directly affected or their representatives to decide what happens to those in their community.
Either necessity, if they don't do the work then they can't paint/whatever, or imperative, if you don't help us fill sandbags to protect the town from flooding then the commune will withhold its support/whatever.
The ideal is for everyone to be able to choose the work they do, and to organize society along fulfilling that ideal as closely as possible.
theguardian.com/world/2013/oct/20/marinaleda-spanish-communist-village-utopia
One solution is to make everyone do necessary work in shifts. Say, divide a community up into four groups, A-D. A works the first week of the month, B the second, C the third, D the fourth. Once you're done with your monthly work, you're free to spend the rest of your time as you wish.
Another is to try and do away with farmers entirely. Food already grows itself, and the process can be easily automated in most respects. When agriculture is organized around feeding people rather than profiting corporations, much of the modern incongruities that currently surround agriculture evaporate.