The the General Assembly, taking into account their contribution

The Security Council has “the primary responsibility for the maintenance of international peace and security” (Article 24 of the United Nations Charter). It is composed of five permanent members, namely the United States, the Russian Federation, the United Kingdom, France, China and non-permanent members elected for two years by the General Assembly, taking into account their contribution to the maintenance of peace and equitable geographical distribution. Outgoing members are not immediately eligible for re-election. At first, there were six non-permanent members. Since 1966, because of the increase in the number of States belonging to the United Nations, there have been ten. The Security Council has therefore been composed of fifteen members since 1 January 1966.
Council members must be available 24 hours a day in case an international crisis occurs. A Member State or the Secretary-General may convene a meeting of the Security Council if peace is threatened. A non-member State may also request a meeting of the Council if it considers that there is a threat to peace. When a meeting is called, the countries directly concerned by a question submitted to the Council are invited to take part in the discussions, but cannot participate in the vote on Council resolutions. A majority of nine members is necessary for the adoption of a resolution, but no resolution (except for procedural matters) can be adopted if one of the five permanent members objects to it—that is, permanent members have the right to veto.
In case of a conflict between one or more countries, the Council may impose economic sanctions against the aggressor which all other members of the United Nations are required to apply. If sanctions are not enough to end the aggression, the Security Council may authorize member states to jointly launch a military operation. The Council only allows these operations as a last resort when all means of peaceful settlement have failed.
In the majority of cases, the Council is trying to negotiate a cease-fire between the belligerents. Once the fighting has stopped, it may happen that the UN sends peacekeepers on site to keep the parties to the conflict separate or to facilitate the implementation of a peace agreement.
Finally, the Security Council recommends the admission of new members to the United Nations. The recommendations also concern the choice of the Secretary General and the judges who will sit on the International Court of Justice.
The considerable importance of the Council’s functions explains its voting procedure. Each member state of the Council has one vote, the majority being nine out of fifteen. But for matters that are not procedural, this majority must include the five votes of the permanent members. A permanent member can thus oppose a majority decision: this is the right of veto. This can paralyze the Council but it is the guarantee regarded as indispensable by the great powers to participate in an organization with an internationalist vocation and of majority quality. Some decisions were made by a majority of non-permanent members without any permanent member voting in favor; it is sufficient if they abstain, do not take part in the vote, or are absent, but it suffices for a negative vote of one permanent member to block a decision having the agreement of the fourteen other members.