Due to more than just his Napoleonic stature, James Madison faced a tall order in navigating US foreign policy and foreign relations during his presidency. Britain and France had been at war since Madison served as Thomas Jefferson's Secretary of State, and both countries attacked US ships to try to draw them into the war. When Madison became president in 1809, these attacks continued. The British began impressing US sailors, forcing them to serve on British ships, and the attacks greatly hurt US trade, angering merchants and businessmen. The British also helped Native Americans in North America attack US settlers.
In retaliation, Madison declared war on Britain in 1812, starting the War of 1812. The US Army was small and under-prepared, and many in the US did not support what they called "Mr. Madison's War." British forces attacked and burned Washington, DC, in 1814, forcing Madison to flee the White House. New England merchants, suffering from reduced trade and a declining economy, threatened to secede from the US at the Hartford Convention.
Despite these setbacks, the US managed to wear down the British. The war ended in 1814 with the Treaty of Ghent, and many Americans considered the war a victory. Madison continues to be remembered as the Father of the Constitution.