The US military is a fucking powerhouse and is more than likely the strongest military on the planet.
Those examples you listed…let’s talk about them.
Vietnam. It’s true, that the Communist Vietnamese were able to defeat the French military but they got their shit kicked in and were humiliated by the US military. Even while waging a Guerrilla War, and even with their populace being a hardy people with a lot of experience in Guerrilla War, the Viet Cong and NVA were decimated. They could not win on the battlefield. The best they could do was the Tet Offensive, yet that only ended with a crushing defeat on their end. They only “won” because the American people realized our tax dollars and our efforts were better spent elsewhere than a country nobody even knew existed before the war.
Afghanistan. We already had a minor presence in Afghanistan and only “lost” because, again, the American people and government realized our tax dollars and efforts are better spent elsewhere.
If you think these wars are examples of how weak the US military is, then I would like to educate you. Look no further than Operation Desert Storm which has been described as a “Fucking Masterpiece.” Air Superiority was established within hours and the Iraqi military was stomped into oblivion.
The US military is not defeated, it’s recalled for other operations