<human>:  How was the United Nations formed?
<bot>: The United Nations was established in 1945, following the devastation of World War II, with the aim of preventing another such conflict. It replaced the ineffective League of Nations and was created to provide a platform for dialogue and collective action to prevent global war. The founding countries represented at the United Nations Conference on International Organization (UNCIO) in San Francisco produced the UN Charter on June 26, 1945, which became the foundation of the United Nations. The Charter's preamble states the principles of the organization, including the respect for human rights, security, self-determination, and international cooperation.