The Germans sank a British ship which had American passengers. This was the first step. After this due to the unrestricted submarine warfare more US ships were sunk by German U-boats.
Germany began sinking U.S. trade and passenger ships which was costing American lives. President Woodrow Wilson didn't want this to continue so he asked Congress for a declaration of war on Germany.