We do the best we can.
We made a mistake in allowing the governments of both Afghaistan and Iraq to be other than civil secular governments with no religious allegiance. We also made a mistake in telling these people we were other than an army of liberation and occupation (like Japan and Germany) until they got their act together.
Perhaps next time we should liberate the country the way we did Japan.
Maybe we shouldn't waste our time.
It will take a lot longer then it did with Germany and Japan to change the mindset of an Islamic country.
What is it, working on 1400 years now and still stuck in the stone age?