As long as we have our own interests, beliefs, and possessions, we will stay involved in conflicts. Governments incapable of getting consensus refer to their armies and make their intentions clear. A war is inescapable where negotiations fail, and global leaders have not yet found the way to break this vicious circle.
International conflicts often evolve from trade and economic relations. In the 21st century, human society is still dependent on natural resources that are not only scarce but also concentrated unevenly. Fighting for a land and what it contains is an ancient way to address the well-being of countries, but a developed society cannot allow themselves to behave like that. We shall stop depending on imported resources and generate that of our own. We can create renewable energy and give up on this rivalry.
Social issues are another common reason to start a war. We will never find the way out of armed conflicts as long as some people consider themselves superior to others. It is important for societies to eliminate prejudice and concentrate on their own development rather than compare themselves to others.
It would be difficult for humans to give up on war anyway, but finding a gene of greed and destroying it could help a lot. Somehow, people are never satisfied with what they have and strive for more goods, especially if they can simply go and take it. Perhaps, humankind shall evolve further and change the way of thinking to stop trespassing on foreign lands.