Before the U.S. entered World War I in 1917, they had a policy of neutrality. It means they should not have any permanent alliances, and that it should remain distant from the wars of Europe.
The United States claimed the right to trade with anyone that they wanted; they claimed the right to loan money to anyone who wanted it; they believed in the freedom to travel, to work with, and to interact with anyone in the world that they wished to work with.
But everything changed, the British did not want the United States in 1812 trading with France, and the British did not want the United States in 1914 trading with Germany. And by the same token, the Germans did not want the United States trading with Great Britain.
It was a difficult issue because not only was the United States trading with all of the belligerents; they were also loaning money to all of them.
The danger was stiffer competition for America's exports. British controlled the seas, especially the Atlantic to stop American shipping. It cut off much American trade to Germany. And because of this Germans invested in submarines to destroy shipping going to Great Britain.