You can never tell. But you can't live your life that way. It's like never being able to cross a road because you're scared you'll get hit by a car. All you can do it look both ways and cross otherwise you'll never get to your destination, but some people somewhere are just going to get hurt anyway and there's nothing you can do about it.
Part of being in a relationship is believing that they want it to work, and you want it to work, so they wouldn't cheat, and you wouldn't cheat. If they cheat then they clearly are not really committed to the relationship, not ready to settle down or don't like you enough to keep it going. So if they cheat it is probably best that it is over. So being afraid that they might cheat is actually being afraid that they don't really want to be with you, they don't accept you, you're not good enough, you're unattractive, you will never find a partner that will be loyal to you. But in a relationship you can't go on thinking like that, you have to believe that they do like you and they want it to work out. (though that doesn't mean you should be already thinking about the wedding and planning how many babies you are going to have, haha! I'm not saying that you should plan it out.)