I felt that Trump rightly picked up on the US population exhaustion on foreign adventures and was not interested in playing that game that resonated with a lot of military types.
This policy direction, however, was one that reaches back to W Bush's presidency. Rumsfeld's stated aim, and oft heavy handedly implemented, was to get the US out of foreign ventures. That included a drawdown in Afghanistan as well as very limited objectives and low troop numbers going into Iraq (leaving aside the issue as to whether going into Iraq was really necessary) To paraphrase US policy at the time it was to "hit hard and get out."
The trouble was that events and the enemy had plans of their own. While the Iraqi military and the Saddam regime were easily defeated, the insurgency there and the rise of ISIS created a whole new conundrum.
In Afghanistan, at the time, no one saw Dadullah's offence in the south shape up. By all appearances the US could get out, but ...
By the time the Obama administration took over it had inherited the consequences of what went had gone on before it. A lot of doubling down had to be done if one didn't want to leave behind a a couple of Petrie dishes within which the next crop of international terrorists could thrive and multiply.
Let's be honest. By the time Trump took over, the US had gotten out of everywhere. A few observers/advisers were left behind to try to steer things along, but the tens, even hundreds, of thousands of Americans (and allies) who had been in Iraq and Afghanistan, had long gone home. From a high of 102,000 during the height of the 2009-2011 surge in Afghanistan to just 12,500 in 2016. Direct US operations had ended in 2014 under Obama. In 2017 Trump in fact increase the troop strength in Afghanistan by an additional 4,000 or so trainers before starting a slow drawdown over the next four years. By the time that Biden took office in Jan 2021, there were only 2.500 left.
The few, regrettable, casualties which came from time-to-time were insignificant militarily albeit that they were a great plaything for both the media and politicians.
Every administration has had the objective of a small war with a quick withdrawal. Events dictated the course of actual progress. There is no one administration that truly succeeded. Each had some successes and each had some dismal failures. America simply can't stop being involved. That's the price of leadership. The problem for America is that there are so many factions and so many information channels that there will always be criticism and downright lying. One can be either be a populist and follow the baying mob one likes best, or one can take a reasoned approach and do the right thing. Regardless of the path chosen there will always be consequences including 2nd and 3rd order ones which won't bear fruit for years. These will in many cases be rationalized after the fact and laid off as someone else's fault. That's the nature of American politics.