"How would x be done in anarchy/communism?"
By councils/popular assemblies united in federations, organised as non hierarchically as possible and based on the principle of "From each according to their abilities, to each according to their needs"/ equality, liberty & solidarity.