For some reason, the idea that wiping out every terrorist on the planet does little to wipe out terrorism is something that many people have difficulty understanding. However, the inability of many people to understand this concept is one of the leading causes to why terrorism, particularly the radical Islamic version, continues to spread and become larger.
In order to first tackle this issue, we must ask the question: why does terrorism grow?
The primary factors for the growth of terrorism consist of (but are not limited to) ignorance, lack of basic education among the people who take up such ideologies, oppressive governments ruling minority populations with an iron fist, or even a battle for natural resources.
So how do we attack and fight terrorism?
Many would respond that if we just kill terrorists, there'll be less terrorists to kill in the future. Of course, this view completely neglects second and third order effects. In order to deal with terrorists and kill them, you need either boots on the ground (actual troops to fight insurgencies) or you can directly use airstrikes. If airstrikes are used, there is a relatively large probability of a miss. A miss can (and has) resulted in civilian casualties while the people who decide where and when to strike do not suffer any negative consequences if they miss. If they happen to hit some child or home in Pakistan that only holds civilians, then the people who were struck are the only ones to suffer. In other words, we have a typical asymmetry in incentives.
On the other side of the coin, civilians see a bomb randomly striking an innocent person's home with American shrapnel flying off. In other words, you're creating an incentive for civilians to turn to terrorism. By bombing places randomly without any proper concern, we actually end up fueling terrorism even though we may end up occasionally killing terrorists. We must recognize that poor, uneducated populations (particularly youth) without sufficient infrastructure are the ones most likely to resort to terrorism.
In order to fight and attack terrorism, what we really need are a new set of ideas. Resorting to bombing places or supporting authoritarian regimes (ex. Saudi Arabia, now Turkey) or boots on the ground--turning the US military into a nation-building force--are not the solutions. Instead, we need ways to educate the populaces of these regions. We need ways to actually change the way that the people and groups in the region think and behave.
Obviously, changing the way that the people in the region think is easier said than done. We need ways of constructing proper infrastructure so that groups like the Islamic State can't influence the hearts and minds of the populace they attempt to control by helping build infrastructure and provide social services.
What about nation-building?
As a way to fight insurgencies and terrorist organizations, we've seen the US military take a role in sending large amounts of troops to fight these insurgencies (ex. War in Afghanistan and Iraq). What the US was really doing was nation-building. The US literally tried to build stable governments as the US military provided security for the region. This is a short-term way to deal with terrorism, but the longer you stay in a foreign land, the more people will get pissed off. Again, this is a long-run way of fueling terrorism although it suppresses volatility in the short term.
Another problem with this strategy is the sheer cost. We have places in the US like California that have rapidly deteriorating infrastructure that we completely ignore fixing while we're building infrastructure in highly politically unstable countries that only show a shed of stability and security due to our military force that isn't even working as a military force (it's working as a security force). Obviously, none of these solutions make any sense and have ZERO chance of working over any extended period of time.
DO NOT GO NATIONALIST!
Basically, we need to avoid the urges to call for nationalism and worry about our problems at home. We need to throw out ideas that turn the free republic into an authoritarian empire as imperialism is inherently unsustainable and will eventually make the country poorer. Using large scale capital inflows to fund deficits and fight wars IS NOT sustainable in the long run and provides little increase in productivity to pay off the debt servicing costs.
Running up trillions of dollars in debt while simultaneously ruining hundreds of thousands of lives in order to sustain nations that really have no reason to exist doesn't make any sense. Quite frankly, it's straight up stupid. Unfortunately, this stupidity has been the hallmark of American foreign policy over the past 3-4 decades.