I’d have said the War of 1812.
I immediately thought of the Spanish American War but actually by the 30s we were in a decline militarily. That doesn’t tell the whole story tho.
In the words of Yamamoto, we were a “sleeping giant” which just needed to awaken. The attack on Pearl Harbor was the big one but we had already begun to stir before that.
The War of 1812 was very nearly the ruination of the country. First, because it was possible the war could have been averted because the government of Britain underwent a shakeup just at the time the US was voting to declare war; new negotiations might have allowed the tension to be resolved. Second, because the US came pretty close to losing it outright. An American sniper killed the top British commander at a critical time, preventing the fall of Baltimore.New England wasnt on board, and its farmers were selling their produce to the British Army in Canada. The peace treaty which ended the war was a relief to the Americans, and - until news of the Battle of New Orleans reached London - was controversial in Britain.
Tho the population of the US was geometrically increasing, it was still small; after 1820 the US would have had the wherewithal to have taken Canada.