The War in Afghanistan did not “fail” or show that the US is “bad” at imperialism because the objective of the War in Afghanistan was never to defeat the Taliban or bring “stability” to Afghans or even to install a lasting puppet regime/client state for the US. The goal was to, among other things, secure Afghanistan’s opium supply (which sources >90% of the heroin currently being trafficked worldwide), establish US military bases on the borders of Iran and China and within proximity to Russia, and generate profit for the military-industrial complex by justifying supermassive “defence” budgets and arms sales. When the costs outweighed the benefits of staying in Afghanistan the US cut its losses and left. The people of Afghanistan, the Taliban, the US-backed regime etc. are/were simply all pawns at best or hindrances/collateral damage at worst. Do not allow yourself to be duped into thinking anything more or less of this situation.
I hope this becomes common knowledge in America and western countries as well. It's so frustrating to see everyone believe what their imperialist, war criminal governments say about countries they've destroyed while everyone thought they were there for "peace".