First and foremost: Stay ALERT!
Pay attention to what is going on around you, glance around often just to check out your surroundings.
If your intuition or instinct kicks in and you feel that you are likely being followed, cross the street and see if the person follows. Speed up and look to see if they do.
Don't panic, tell yourself to keep calm. Look for a public place where there is a group of people, restaurant, stores or gas station. Anywhere that has a group of people, anywhere a potential attacker would not be able to make a move without being seen.
Never be embarrassed about turning around and looking to see if the person is getting closer. This alerts the potential attacked that you are fully aware of their presence. Then, scream loudly! For example, yell something like: "Stop following me! I don't want anything to do with you! Go away!" If you can't think of anything else, yell "Fire!" really loudly. Then run or get away.
If you have a cell phone, call the police at the same time as continuing to walk to somewhere safe. Announce that you're calling the police.
Do not go straight home, this will show the potential attacker where you live.
If you are actually attacked, hit, punch, poke their eyes and scream as loud as you can.