Answer by taking a quote from the following article:

Wilhelm II (Friedrich Wilhelm Viktor Albert von Hohenzollern; 27 January 1859 - 4 June 1941) was the last German Emperor (Kaiser) and King of Prussia, ruling the German Empire and the Kingdom of Prussia from 15 June 1888 to 9 November 1918. He was the eldest grandchild of the Queen Victoria of the United Kingdom and related to many monarchs and princes of Europe, most notably King George V of the United Kingdom and Emperor Nicholas II of Russia. Acceding to the throne in 1888, he dismissed the Chancellor, Otto von Bismarck, in 1890. He also launched Germany on a bellicose "New Course" in foreign affairs that culminated in his support for Austria-Hungary in the crisis of July 1914 that led in a matter of days to the First World War.

German foreign policy under Wilhelm II was faced with a number of significant problems. Perhaps the most apparent was that Wilhelm was an impatient man, subjective in his reactions and affected strongly by sentiment and impulse. He was personally ill-equipped to steer German foreign policy along a rational course. It is now widely recognised that the various spectacular acts which Wilhelm undertook in the international sphere were often partially encouraged by the German foreign policy elite. There were a number of notorious examples, such as the Kruger telegram of 1896 in which Wilhelm congratulated President Paul Kruger of the Transvaal Republic on the suppression of the British Jameson Raid, thus alienating British public opinion.  British public opinion had been quite favourable toward the Kaiser in his first twelve years on the throne, but it turned sour in the late 1890s. During the First World War, he became the central target of British anti-German propaganda and the personification of a hated enemy.  Wilhelm invented and spread fears of a yellow peril trying to interest other European rulers in the perils they faced by invading China; few other leaders paid attention. Wilhelm used the Japanese victory in the Russo-Japanese War to try to incite fear in the west of the yellow peril that they faced by a resurgent Japan, which Wilhelm claimed would ally with China to overrun the west. Under Wilhelm, Germany invested in strengthening its colonies in Africa and the Pacific, but few became profitable and all were lost during the First World War. In South West Africa (now Namibia), a native revolt against German rule led to the Herero and Namaqua Genocide, although Wilhelm eventually ordered it to be stopped.  One of the few times when Wilhelm succeeded in personal diplomacy was when in 1900 he supported the marriage of Archduke Franz Ferdinand of Austria to Sophie Chotek, against the wishes of Emperor Franz Joseph I of Austria.  A domestic triumph for Wilhelm was when his daughter Victoria Louise married the Duke of Brunswick in 1913; this helped heal the rift between the House of Hanover and the House of Hohenzollern which followed the annexation of Hanover by Prussia in 1866.

what foreign affairs was emperor involved in?
President Paul Kruger of the Transvaal Republic on the suppression of the British Jameson Raid,