Ok Joe, here is what I would recommend you doing in Afghanistan.
Draw the troops out in as an orderly fashion as possible. Dont delay, dont hurry, just do it at the pace you find is the right.
At the same time, you need to get some pay back from the attack of Isis at the airport.
Send in the drones, make the attacks precise, only hitting exactly the targets that were involved in the attack on the airport, and then just continue from there. Whittle them down from the top.
What is really important is to avoid any civilian casualties. Be very, very careful. As this is a war of bombing, it is also the war of hearts and minds. Be careful not to hit any of our friends, but on the contrary help our friends. They need to be taking responsability for their own country, but we should be VERY adamant in trying to support the pro democratic movement in the country. As in the Arab spring, remember?
Now, off cause the Arab spring was different, it was just in the first term of Barack, and we were very popular at the time. So we cant rely on the support of the people at the same level. But I mean, we are in it for Democracy, and those who support us, we should support. Not nation building, but the support of those who share our values and worldview. That is fair, and hopefully, the people of Afghanistan will like our approach.
And then be adamant about that, say that you are not in it for nationbuilding, but you still support the Democratic cause, and any who do the same, will be your ally.
And then do it, without risking American lives anymore, the public is warweary, that is fine, but they still want the cause of Democracy to be seen as something worth supporting, and they will support that.
Anyway, be clear about your priorities and then just start cutting the head off the snake, so that it keeps out of the US.
G-d bless the will to be vigilant and fast in action, and you can do this Joe, it is difficult, but you can do it.