In those very limited circumstances where the terrorists are segregated from the general population, they can be eliminated by the ruthless use of physical force. Otherwise, successfully fighting terror requires patience and fortitude more than anything else. Effective police work, cooperation with the public, and control of the ideological narrative are essential, and overreactions must be avoided. Terror will stop when it becomes clear that it won’t work.
You can’t discredit your opponents; they can only discredit themselves. I’ve always thought it would be a good idea to put terrorists on TV and have them interrogated by people who know the subject much better than they do. Watching an Islamic terrorist make a fool of himself in public talking about his religion would do more than anything I can imagine to deter wannabes.