There is, of course, both private and public international law. You don't know what you're talking about.
In contrast, if you go rob a grocery store, you can't just opt out of punishment. "I'm not a member of this court system" does not work as a viable defense strategy, even if some souvreign citizen types sometimes try (and always fail).
International treaties are really just statements of intent and can be withdrawn at any point. Worst that happens is that next time you try to make a treaty, your counterpart may not trust that you uphold your side of the deal. There is no higher authority to effecticely appeal to, in contrast to the grocery store case.
It stops at international law because thats the only level without a governance system over it.
There is no governance system over the USA, UK, etc.
There is a governance system over Ohio, New Mexico, etc.
You are only right if you get big enough that you are a peer of the USA, UK, etc. AKA sovereign.
And yes, of course, it can sometimes be hard to enforce international law, just like it can be very hard to enforce national laws. It is illegal to murder people in most countries, yet people murder each other and some people get away with it.
There are things like the UN which some states, not all, agree to uphold the policies of. But they are also free not to agree to uphold the policies of the UN.
So ultimately it's a bunch of peers in an an anarchic system that do the best for themselves to persist. Cooperation, war, etc.
I am always shocked by how controversial this take can be.