This is one problem needs to be rooted out at its core. I think people most of the time mislooked the reasons. People say it's just religious issue, but personally I don't think it's simply that. Do drug cartels did their activities by religious issues? Does the IRA is also based on religious issues? Does the PLO also works because of religious issues?
Nope, they don't. They might just probably happened to be religious people, but they have something they want. There are 2 forms here, one because they need something, then because they want something that they lost, back. Be it business, influence, land, rights, etc.
A simple example would be the recent war. The US claims there are WMDs in the Middle East, but until now, there's nothing. If you're a citizen of Afghanistan for example, how would you feel? You country is invaded, you have nothing to do with the government - just a citizen, your family killed, you lost your properties. Do you feel it is justified when what the invaders claimed is still not within sight after so many years? That's why they rose up and fight in their own way aka terrorism, they don't have jets, battleships, etc. For these people who lost everything, they see groups that took the opportunity to go against their enemies, as heroes.
Although, yes, I agree that some groups are using religion as a mean to justify their actions. Personally, these groups are using religion as a tool to tell the world what they did is right. If you need to give a reason, religion is something easy to begin with. If let say you don't want to go to a pub for example, just say that your religion disallows you to drink. Nobody will ask why it is prohibited. They just simply accept it. Such thoughts are dangerous, especially for the depressed minds, they are too easy to influenced by. Influencing the Afghanistan people who lost everything in the war (being in the same religion obviously helps a lot)? Child's play. Then you'll get a whole lot of soldiers for your terrorist plans.
As how to deal with it, human need to stop being prejudice. Not every Muslim a terrorist, not every Colombian is a drug cartel member, not every Mexican an illegal immigrant, not every Chinese is a member of a triad, etc. People need to know the root of the others before making decisions. That is on personal level.
As for government level, personally I'm satisfied with the security level atm, especially after 9/11. Of course they can always increase the efficiency and bring up more plans to further enhanced the safety. Information network is certainly needed. Countries need to be able to share information quickly and fully, means not hiding certain facts if they can.