There were two major ways that African American men contributed to World War I.
First, African American men took many jobs in war industries -- jobs that had formerly been held by white men. During the war, over 400,000 southern blacks started moving north to take jobs in factories.
Second, about 400,000 black men were in the Armed Forces during the war. Because of the prejudices of the time, most of these men were not allowed to serve in combat units. Instead, they were forced to work in menial jobs, doing things like unloading ships. However, two divisions of black soldiers did go into combat. One under American command, did poorly. The other, under French command distinguished itself.
African-Americans contributed to World War I on the home front by working in war plants that manufactured weapons and other materials needed by the U.S. Army. During the Great Migration, which picked up speed at the beginning of World War I in 1914 and that lasted during its first wave until 1920 (though it continued well into the twentieth century), about 500,000 African-Americans left the south and went north to cities such as Detroit, Chicago, Cleveland, and New York to work in factories. The south at that time was still subject to Jim Crow legislation that declared that "separate but equal" was still equal. However, the facilities and opportunities open to African-Americans were not equal to those of whites. Newspapers such as the Chicago Defender, an African-American newspaper, urged African-Americans to go north in search of better jobs and more equality. While African-Americans often earned higher wages in the north than they did in the south (where they carried out jobs such as working as domestic servants for very little money), they often faced discrimination and even violence in the north (for example, in the race riot in East St. Louis in 1917).
In addition, African-Americans soldiers served in World War I, and many saw military service as a way to promote racial equality. About one million African-Americans responded to the American draft, and about 370,000 African-Americans served in the war. Many African-Americans served in units that carried out manual labor and that were not involved in combat, and they faced racially segregated units and housing in the army, in addition to often lower pay. About 200,000 African-American troops served in France. The most famous combat unit was the so-called "Harlem Hellfighters" from New York. Many African-Americans thought the war would lead to increased equality, but it didn't in many ways. The campaign for civil rights continued long after the war.