As far as I can tell, only one American soldier was killed as a result of hostile action in Afghanistan in 2020, although I suspect there might be others who were killed by hostile action in with intelligence and mercenary forces, and aren't reported. Given the number of troops there, they were probably safer than they would be driving around the American south, since they tend to be risk-takers.
The biggest problem with Afghanistan from an American perspective was the cost, not the lives, at least, not in the last few years. There were fewer American death in Afghanistan in 2020 than there were in the Indianapolis murders yesterday. A progressive would tell you that the money would be much better spent in American communities rather than in a war in Afghanistan. The withdrawal of American troops could possibly lead to a catastrophe, like the one that followed the American departure from Vietnam. However a column on the subject in either the Washington Post or the NYT suggested that the modernization of Afghanistan since the American occupation will make it much more difficult for the Taliban to effectively take over and rule, as millions of people won't want to go back to what was essentially a religion-based rural and tribal economy before the American intervention -- that is, that the Afghani government may be better positioned to resist than it once was, because of support in the major cities.
So, we shall see. I have a feeling that, on balance, withdrawal will be eventually seen as a mistake. I'm very aware that I could be wrong.