I would say, they are both complicated.
Afghanistan shows that trying "nation building" on a place where they don't actually want any nation doesn't really work. But it did work for Japan and Germany after WW2, so maybe it was worth trying. I'm sure the women who are now forbidden to learn to read liked the Americans more than they like Taliban, but does that mean extending the war was worth it?
As for Iraq, the WMDs were a complete lie and Bush and Cheney just wanted more war - some say Cheney was the mind behind and Bush was just idiot, some say Bush wanted to finish what his father started - but average Iraqi is now better off than with Saddam. That doesn't help those who died in the war, of the people who could have has better lives for the money the war had cost though.
It was actually Ukraine that changed my opinion on Iraq, because the arguments "Iraq under Saddam's brutal dictatorship wasn't that bad, there was no reason to war" started resonate with "don't help Ukraine, their lives aren't going that bad under Putin's brutal dictatorship, tell the to surrender" little too much. Was Iraq different from Ukraine only because in one the dictator was status quo and in the other it wasn't?
Yeah, complicated.