They didn’t “supply weapons” to the Taliban. They recruited tens of thousands of fanatic young muslims in various middle eastern countries - through Saudi Arabia, specifically bin Laden - and brought them to Afghanistan to fight the Soviets. We know those fighters as mudjahideen. They fought the Russians for ten years in Afghanistan, which led to both millions of casualties among the population and about 5 million refugees that went to Pakistan.
Living in slum conditions in Pakistani camps, the only “education” an entire generation of Afghan children got was an extreme teaching of the Qu’ran through a Pakistani political party which ran the schools in those camps. After the Soviets left in 89, Afghanistan was in a state of perpetual quarrel between the government and the various mudjahideen groups and in the mid 90s, a group of people made up of former refugees, the Taliban, started to compete for power, too. Over the course of the civil war, they gained more influence, power, and also the remaining weapons the mudjahideen had been provided with by the US.
To sum it up:
US recruits, arms and finances mudjahideen to fight Russians, war creates millions of refugees, refugees are indoctrinated in Pakistan, return to Afghanistan, form Taliban, gain power.
As for the US arming ISIS. That group wouldn’t even exist - certainly not at this level of power - without America destroying Iraq. The US and the UK should be forced by the international community to take on any refugee coming from Iraq and to pay massive reperations. We know this won’t happen, of course.