The principle task of the International Court of Justice is to try settle conflicts between nations. It also acts as an advisor on legal issues for he UN.
The International Court of Justice, which is the primary court for the United Nations, handles legal disputes submitted by states/nations, and gives legal advice/opinions upon request to the UN.