The exiting of US troops from Afghanistan began in the previous United States Presidential administration. The current just finished the job. The US has been there shortly after 9/11 which means forces have been there for 20 years. I believe we did everything we could to help keep the Taliban at bay in that time.
It should never be a forever war and knowing trillions have been spent and thousands of military lives have been lost there is heartbreaking. Also heartbreaking is knowing that the lives women, LGBTQ, and some on the fringes will be in peril. It truly is a no-win situation.
What more can be done? Being there indefinitely is not an option. Afghanistan forces lost major cities and they fell like a house of cards. What took years to secure took only weeks to lose. God be with those who face a very dangerous and uncertain future.