In a perfect world (which we are miles from)?
The UN would be made up of it's own, separate armed forces (manned with all volunteers).
And every country would donate 1/2 of 1% of their GDP to the UN military (right now - the world military spending average is 2.4% of GDP)
https://en.wikipedia.org/wiki/List_of_countries_by_military_expenditures
This equals about $400 billion per year and would render every country safe from invasion except from America and maybe China.
And it would save the world, huge amounts in military spending.
I know it would never fly.
But it would spell the end of almost all wars...potentially.