The United Nations does a number of things to try to maintain peace in the world. They can generally be broken down into three categories.
First, the UN does what is called peacekeeping. In instances like this, it sends armed forces under its control (contributed by member nations) to separate the two sides in a conflict. The UN troops are there to prevent the sides from attacking one another while peace is negotiated.
Secondly, the UN can provide or threaten collective security. In some cases, the UN will threaten military action or economic sanctions. The UN will do this to try to keep a particular country from continuing to take actions that might lead to war.
Finally, the UN does many less direct things to keep the peace. It has many agencies that are meant to promote economic and social development. These agencies try to reduce poverty and other causes of conflict. The UN also provides a forum for countries to interact with one another in hopes that the constant contacts will help encourage the countries to solve their differences peacefully.