As far as preventing war in general, the Korean War, Vietnam, Soviet invasion of Afghanistan, the Falklands, two gulf wars, Russian invasion of Ukraine, etc, etc. UN mediation is no more effective than any other major power mediation efforts in history, in fact it can be argued the UN has been less effective.
The key method to avoiding war is to spread democracy, which is why the UN is such a failure, and it’s charter is the prime reason.