Terrorism is the sin of killing innocent Muslims and innocent non Muslims and can be prevented in Islam by explaining and understanding Islam as explained on these websites inshallah (God willing, Allah willing).
God website https://sites.google.com/view/islamandthekoran
Allah website https://sites.google.com/view/islamandthequran
Allaah website https://sites.google.com/site/islamandthequran
Q&A website https://sites.google.com/view/quran-tanakh-gospel