The problem in Afghanistan was made over decades (perhaps centuries if you want to go back that far) and thus cannot be fixed in a few years.
Most Afghanis are peaceful tribesmen who took up arms to defend their tribe / family. After decades of neglect, then Soviet invasion, most of them got brutalized into fighting machines as they knew nothing else. When the Soviet Union left, and so did the American aid, the warlords started fighting each other, and Taliban came in and offered their version of "peace", which didn't turn out that well, but they probably will have been left in place if they didn't try to shelter Osama Bin Laden.
Now that Taliban is gone, and a civilian government is in place, the warlords are not ready to give up their power, and Taliban sympathizers and remnants don't want to give up their hyper-Islam for secular ways. The proliferation of weapons means terrorism is always around the corner. Add to that Afghanistan has a severe lack fo communications and roads means a "central" government will never really be able to rule the outer reaches effectively, which lead to part of the chaos. The lack of much of an economy doesn't help either, nor does the lack of infrastructure after decades of fighting.
There was a story about how some villages growing opium (it was a staple crop for the Taliban controlled villages) transitioned into growing saffron (and that is a VERY valuable spice). THAT is a good move as it both props up the economy AND gives the village something to do.
Not sure what happened to that village now. I heard some what village elders got killed because they collaborated with the central government.