The assassination of Archduke Ferdinandsen set off a chain of events that created the World War 1 Declaration of War Timeline.
Each country was involved in multiple treaties, which set off a domino effect throughout Europe and the world that would cause many different nations to declare war on each other based on those treaties.
George Washington warned about the "entangling alliances" of Europe in his Farewell Address. This is certainly one of the examples of why it is important to avoid those alliances.
Timeline
Australia
Entered war together with Britain on 4 August 1914
Austria-Hungary
Declared war with Serbia on 28 July 1914
Declared war with Russia on 6 August 1914
Declared war with Belgium on 28 August 1914
Declared war with Portugal on 15 March 1916
Belgium
Invaded by Germany on 3 August 1914
Bolivia
Severed relations with Germany on 13 April 1917
Brazil
Severed relations with Germany on 11 April 1917
Declared war with Germany on 26 October 1917
Bulgaria
Declared war with Serbia on 14 October 1915
Declared war with Romania on 1 September 1916
Canada
Entered war together with Britain on 4 August 1914
China
Severed relations with Germany on 14 March 1917
Declared war with Germany on 14 August 1917
Declared war with Austria-Hungary on 14 August 1917
Costa Rica
Severed relations with Germany on 21 September 1917
Declared war with Germany on 23 May 1918
Cuba
Declared war with Germany on 7 April 1917
Ecuador
Severed relations with Germany on 8 December 1917
France
Invaded by Germany on 2 August 1914
Declared war with Austria-Hungary on 12 August 1914
Declared war with Turkey on 5 November 1914
Declared war with Bulgaria on 16 October 1915
Germany
Declared war with Russia on 1 August 1914
Declared war with France on 3 August 1914
Declared war with Belgium on 4 August 1914
Declared war with Portugal on 9 March 1916
Greece
Declared war with Austria-Hungary on 27 June 1917
Declared war with Bulgaria on 27 June 1917
Declared war with Germany on 27 June 1917
Declared war with Turkey on 27 June 1917
Guatemala
Declared war with Germany on 23 April 1918
Haiti
Declared war with Germany on 12 July 1918
Honduras
Declared war with Germany on 19 July 1918
Italy
Declared war with Austria-Hungary on 23 May 1915
Declared war with Turkey on 21 August 1915
Declared war with Germany on 28 August 1915
Declared war with Bulgaria on 19 October 1915
Japan
Declared war with Germany on 23 August 1914
Declared war with Austria-Hungary on 25 August 1914
Liberia
Declared war with Germany on 4 August 1914
Montenegro
Declared war with Austria-Hungary on 5 August 1914
Declared war with Germany on 8 August 1914
Declared war with Bulgaria on 15 October 1915
New Zealand
Entered war together with Britain on 4 August 1914
Nicaragua
Declared war with Austria-Hungary on 8 May 1918
Declared war with Germany on 8 May 1918
Panama
Declared war with Germany on 7 April 1917
Declared war with Austria-Hungary on 10 December 1917
Peru
Severed relations with Germany on 6 October 1917
Portugal
Entered war against Germany on 9 March 1916
Entered war against Austria-Hungary on 15 March 1916
Romania
Declared war with Austria-Hungary on 27 August 1916
Exited war with Treaty of Bucharest on 7 May 1918
Re-entered the war on 10 November 1918
Russia
Declared war with Turkey on 2 November 1914
Declared war with Bulgaria on 19 October 1915
San Marino
Declared war with Austria-Hungary on 3 June 1915
Serbia
Declared war with Germany on 6 August 1914
Declared war with Turkey on 2 November 1914
Siam
Declared war with Austria-Hungary on 22 July 1917
Declared war with Germany on 22 July 1917
Turkey
Declared war with Romania on 30 August 1916
Severed relations with the United States on 23 April 1917
United Kingdom
Declared war with Germany on 4 August 1914
Declared war with Austria-Hungary on 12 August 1914
Declared war with Turkey on 5 November 1914
Declared war with Bulgaria on 15 October 1915
United States of America
Declared war with Germany on 6 April 1917
Declared war with Austria-Hungary on 7 December 1917
Uruguay
Severed relations with Germany on 7 October 1917