former Yugoslavia is good example. Nation build on communist principles (as close to it as it gets at least) & it worked well, until US started funding nationalists to create division.
US used exact same trick in many other nations, they are still doing in right now in Venezuela and Syria.
Only reason why it APPEARS that Socialism or Communism doesn't work is because the capitalist west has always been attacking it, militarily and economically.
So unless you go much deeper under the surface and see what is going on (which most people don't) you don't get to understand what is going on why things happen the way they do.