The United Nations provides a place for the countries of the world to do two things.
First and most important it allows countries a neutral means of communication. This is important because most conflicts that don't involve fighting over things can be resolved if both sides sit down and talk it out.
Second the United Nations is in a basic sense is a world government. It regulates the activity of the world's governments. That being said, the amount of power the UN can exert on a sovereign nation is basically up to that nation. The UN is a place where treaties can be agreed upon, such as human rights issues, or pollution control, which generates the laws which the UN can impress upon its members, via the UNSC and ICJ.
Thirdly, the UN generally works towards world solutions to avoid more
serious problems and to work toward the world getting along better