The problem with UN is its Security Council.
It has permanent member countries that can veto any UN decision even if all other countries in the world voted in favor of it.
Is this really democratic enough?
If not then what would be the best way?
Clearly the fundamental feature of democracy is majority rule.
So one possible improvement would be to make Security Council use majority rule.
(But Security Council having permanent members still would be a problem for democracy.)
I think the best solution would be to get rid of Security Council.
But that by itself would cause a big problem.
Because big powerful countries in the world having the same voting power with small countries would not be fair really.
The solution is to give a weight to the vote of each country. But how?
Calculating the weights (each year) based on military power would lead to a global arms race.
Which would be really bad for the world.
Calculating the weights based on population would lead to a population race which would be also bad for the world.
Then clearly the vote weights must be based on "more the merrier" kind of indicators/statistics about a country like economic power (including distribution of wealth), scientific/technological power.
Even education and/or healthcare quality/distribution can be added to the weight calculation formula.