2. Attack people who help terrorists
This was what happened in Afghanistan. The USA and Britain attacked the Taliban government for allowing al-Qaeda to set up bases. Without help it is harder but not impossible for terrorists to operate.
3. Prevent attacks
Improving security at airports, stations and public places has stopped attacks. Getting the public to be more vigilant is also important.
There is always a new target or a new type of attack - so it's hard to be ready for everything
4. Political answer
Involving groups of people with terrorist connections in politics. This can be very unpopular because it might look like the terrorists have won.