This question can refer to numerous wars. Here is a list of different wars you may be referring to:
1) World War I- The US abandon the policy of neutrality for multiple reasons. One of them was the German's use of unrestricted submarine warfare on ships containing American goods and citizens. The German's sank a British passenger ship, the Lusitania, that contained over 100 American citizens. These citizens were killed in this attack. Along with this, the United States also learned about Germany's attempt to make a secret alliance with Mexico in which Mexico would invade the US to prevent them from helping the Allied Powers. The US found out about this through the interception of the Zimmerman Telegram by the British. These two factors caused America to enter World War I.
2) World War II- The United States entered World War II after the Japanese military bombed the US military base called Pearl Harbor in Hawaii.