It is very hard to avoid all ICO scams and frauds, because there are always people and projects that look very legit, but in the end they are just running away with your money. You should do a lot of research about the people behind the project before you invest into ICOs.