It is the world forum of diplomacy. In it, all countries may make statements to other countries. There are also mechanisms for celebration, sanctions, and sending aid workers to assist other nations.
The other purpose is to ensure *legal* military actions. The UN grants or denies military actions as legitimate or illegitimate, and allows other nations to vote on that legitimacy. For example, Russia didn’t seek a UN resolution against Ukraine: thus it is illegal warfare. The USA *did* receive UN approval to invade Iraq in 1991, but not in 2003 (thus making the action as questionable as Russia’s foray into Ukraine).
Latest Answers