To finalize the Afghan situation might be impossible. Almost certainly is, with the small number of troops that can be allocated from a small, all volunteer military.
To finalize WWII, we stationed enough troops, to "De-Nazify" Germany. Same for Japan.
Two things in common with wars that stayed won:
1. Plenty or troops, willing to keep boots on the backs of the defeated nation
2. Willingness to bomb the enemy to smithereens and back
That really set the stage, to go in, say "we won, and we are here to make sure you stay in line."
IMO we now have too many PhD generals who specialize in half-measure uncertain outcomes, and too few real warriors that get the entire job done.
Iraq since 1991
Afghanistan since 2001
What are we doing, why are we doing it, when are we going to stop?