Only the US sanctioned Cuba and while it was pretty harmful, they were still able to trade with most other countries. North Korea has China right next door as a big trade partner, and can trade with many non-US countries as well. As for Iran, from what I can tell UN sanctions really only started to ramp up in the 2010s and those did have an effect in getting Iran to suspend its nuclear program.
Edit: But to be clear, I think the US sanctions on Cuba are gratuitous and cruel. Cuba is not some rogue state and there are many worse dictatorships that aren't sanctioned. However, I think it reinforces the point that "sanctions can be devastatingly effective applied by a significant majority of the world" because in the Cuba case the rest of the world didn't agree.
Edit: But to be clear, I think the US sanctions on Cuba are gratuitous and cruel. Cuba is not some rogue state and there are many worse dictatorships that aren't sanctioned. However, I think it reinforces the point that "sanctions can be devastatingly effective applied by a significant majority of the world" because in the Cuba case the rest of the world didn't agree.