Avoid patterns of behaviour. Predators rely on them to plan attacks – such as breaking into your house, or finding you unawares at the gas station. So vary the times you come and go, and vary your route.
Keep situational awareness. Beware of what is normal in your office, your neighbourhood, basically any place you frequent. By knowing what is normal, you'll be able to see when things change, such as a car in the wrong place, or an abrupt departure.
Trust your gut. The inkling that something is wrong should not be ignored. Often women especially try to brush the feeling aside, but it is there for a reason. If something doesn't seem right, it probably isn't.
Pay attention in public. By keeping your nose in a book or your phone, you're not focused on your surroundings. Your phone, incidentally, can be grabbed out of your hands so easily and a thief could disappear off the train with it before you've even comprehended that there is a threat. If someone is looking for someone to harass or something to steal, make sure they don't pick you.
Have a buddy system. Let a friend know where you'll be and when you expect to return. Even something as innocuous as working late can be an opportunity for bad guys to seize, so make sure others know where you are.
Don't look like a victim. Do not avoid the gaze of strangers, but don't give them a hard stare either (it can be challenging). Walk confidently, don't text and walk, and keep your head up.
Prepare for the worst. Either buy a gun and be trained and prepared to use it, or take self-defence classes so you have a fighting chance of survival.