The League of Nations was a precursor to the UN which did include enforcement, it turns out that is really complicated. One description was that collective security:
failed ultimately because of the reluctance of nearly all the nations in Europe to proceed to what I might call military sanctions … The real reason, or the main reason, was that we discovered in the process of weeks that there was no country except the aggressor country which was ready for war … [I]f collective action is to be a reality and not merely a thing to be talked about, it means not only that every country is to be ready for war; but must be ready to go to war at once. That is a terrible thing, but it is an essential part of collective security.
The League of Nations was a precursor to the UN which did include enforcement, it turns out that is really complicated. One description was that collective security:
https://en.wikipedia.org/wiki/League_of_Nations