Germany had long anticipated a war in Europe and had planned accordingly. The German plan, the famous Schlieffen plan, devised by Count Alfred von Schlieffen, would enable Germany to fight a two front war. The plan called for Germany to first invade France and capture Paris. After Paris was captured and France eliminated from the war, German troops would then be shipped East to attack Russia.
Germany's actual entry into the war resulted from the mobilization of Russian troops following Austria's declaration of war against Serbia. Russia was allied with Serbia; and Germany with Austria. More importantly, Germany saw the mobilization as a threat to its own borders since Poland a natural buffer, did not exist. When Russia refused to cease mobilization in response to a German ultimatum, Germany declared war on Russia, and simultaneously issued an ultimatum to France demanding that France state its position. The French answer --that France would look to its own interests--was deemed insufficient, and Germany declared war on France and implemented the Schlieffen plan. The plan required German troops to march through Belgium as near the English channel as possible; in fact in devising the plan, von Schlieffen had said:
Let the last man on the right brush the English Channel with his sleeve.
Germany demanded permission from Belgium to cross its territory, which demand was denied. As a result, Germany invaded Belgium to implement the plan. This violation of Belgian neutrality provoked a declaration of war from Britain.
Germany did not go to war to achieve specific aims. It would have been happy to maintain territory gained during the Franco-Prussian War. However, it did take steps to protect its territory and sovereignty, which ultimately led to the war itself.
Contrary to the above response, Germany's use of unrestricted submarine warfare was an attempt to bring the war to a conclusion; it had no further aims.
Germany had many different policies leading up to the First World War, but I'm guessing you're referring to its specific policy of isolating Great Britain, its empire competitor, through the Entangling Alliances established by Bismarck in the 1800's. Germany had been competing for colonies abroad and influence throughout Europe since it had unified in the 1860's, and had attempted to outmanoeuvre Britain politically and militarily by building up its navy. The Kaiser (who was related to the British monarchy) wanted "a place in the sun," to compete with his cousins, but found that the choice areas of the world were taken by Britain, leaving him only "a place in the shade."
Germany re-instituted its policy of unrestricted submarine warfare in 1917, destroying American shipping to Britain, which caused the US to declare war.