There were four main causes of World War I: militarism, alliances, imperialism and nationalism. The first world war was a direct result of these four main causes, but it was triggered by the assassination of the Austrian archduke Franz Ferdinand and his wife.
The assassination took place on June 28, 1914 and the first world war began immediately after in August 1914. Gavrilo Princip was the assassinator and was a Bosnian revolutionary.
Militarism was a cause of the war because the war was an "arms race" with Britain, France and Germany competing to build larger armies and navies. In fact, between 1870 and 1914, all of the major powers, besides the United States and Great Britain, more than doubled their army's sizes.
Alliances was a cause of the war because it forced many countries to enter into the conflict even though they were not affected originally. As each country's alliances became involved and then those alliance's alliances became involved, the war grew to encompass the entire world.
Imperialism is the gathering of colonies and in the 1890s, many countries that had not had many colonies decided that they wanted to have more colonies. This led to a global competition for land.
Nationalism is having pride in one's country and believing that one's country is better than other countries. This nationalist pride helped to fuel the war.