The first four presidents of the United States faced similar foreign policy challenges, but handled them in different ways.
When Washington was elected president the U.S. had no navy and only a very small army. Our international credit had not yet been established, and we were surrounded by enemies. For these reasons, Washington declared neutrality and spent the rest of his presidency trying to keep the U.S. out of conflict with European nations. To this end he negotiated the Jay Treaty with Britain and refused to get involved in the French Revolution. Almost immediately the French began taking American ships in reprisal for what they viewed as a gross insult.
When Adams came into office the “Quasi War” with France was his biggest worry. Unlike Washington, Adams used a mix of diplomacy and executive action. Although he refused to declare war, he did send diplomats, who were dismissed during the XYZ Affair, and allowed American privateers to raid French ships while he built the nations first navy. He also used the Alien Act to deport presumed troublemakers. Adams lost reelection for these choices, which were very unpopular, but it did put the U.S. on the road to greater power.
Jefferson also had to deal with impressments and piracy for which he too used a mix of diplomacy and military might. He sent the U.S. navy to attack the Barbary States, eventually ending the threat to U.S. merchant shipping, but when he tried to end impressments by both the British and the French with the Embargo Act, American shipping went belly-up and thousands of sailors were forced out of work. But diplomacy did pay off for Jefferson in the long run when he negotiated the Louisiana Purchase in 1803, doubling the size of the U.S. overnight.
Madison, out fourth president, inherited a very different United States than Washington had. The U.S. Navy was fairly strong, the army was larger than it had ever been and so when the issue of impressments reared its head once again he made the decision to declare war in 1812. The resulting war was disastrous for the U.S. in some regards, like when our capitol was burned, but in other ways it made the country stronger. New leaders came forward to guide the nation, and the last serious Indian threat on the frontier was extinguished.