Never let vulnerable people alone with them and if you are vulnerable yourself...make sure that there are always people around when you're with them. If there are no other people around, let the psychopath know that you have seen him (or, though less often, her).
People who are physically violent prefer to attack by surprise, and from behind.
By letting them know you've seen them, you already improved your chances by 20% or more.
People hardly ever go from totally passive to full attack mode in just a second.
If someone's behaviour gives you the creeps, don't ignore those feelings.
If you think that someone has a knife or worse, then just run. Your fists are no match for a knife.
If someone is not physically but psychologically violent, or in a position of power and abusive, then distance yourself from them.
If that is hard, build a casefile. Raport even the little things and collect evidence.
Make sure there are people on your side. Maybe other victims. Sexual predators usually don't target just a single person once, they often have a history of inappropriate behaviour.
Usually it's women, so:talk to other women. If it's men or boys...same thing.
Again here: don't let people be alone with them and don't be alone with them yourself.