You really just have to do a lot of research. There are definitely scams out there and they get easier to spot as you check out more and more of them. If it seems like they are just selling a bunch of premined tokens with no use, then there is a good chance that they are doing exactly that and just want your cash. Check out their code on the developers GitHub page and see what other people are saying about it. Most importantly, ask the team and the developers as many questions as you can think of.
There are some that take precautions to ensure that their coins won't just be bought and dumped as soon as it hits exchanges. Look at DragonChain, their market price won't even be determined until after the ICO to make it less enticing to whales, and at the end of the sale they are taking the total amount raised and dividing the coins up among the investors, and that is the price it will hit the exchanges at. Basically, there is no reason to dump right away and it makes the whole thing more stable.
That's the kind of thing that I look for in an ICO, a company that wants their tech to be around for as long as possible.