War had broken out in Europe between the French and the British. There was a French Revolution going on (1799-1815), and most of Europe was controlled by France. France needed money so they sold the Louisiana territory to the U.S., which got the U.S. drawn unwillingly into the wars in Europe.
Because the French decided to eliminate British trading, the British decided to block French trading with America. This caused American ships to become caught in the middle, and the Brits forced impressment upon American sailors, making them fight against American settlers and military.
After the Treaty of Paris 1783, the British still refused to leave the Great Lakes land. The British used these lands to help Native Americans and prevent Americans from settling west of the Appalachians. The British gave weapons to the Natives to help fight against American settlers and the military. Americans were angry!
James Madison asks Congress to declare war on June 12, 1812. Congress approved the declaration. This became known as the War of 1812. The military at the time had approximately 3,000 troops and wasn't equipped or properly trained.
During the War of 1812, the U.S. had tried to push the British out of Canada, but wasn't successful. The British in retaliation for the U.S. victory at the Battle of York, marched 4,000 soldiers to the capital, along with former American slaves, and burned down the White house and the Capital.
After a few more battles took place, both sides decided to end the war and sign a treaty. They signed the Treaty of Ghent on December 24, 1814 in Belgium, which officially ended the War of 1812. This was the last war between the U.S. and Britain ever!