Always have money for a bus, a cab or phone call. Don't wear headphones - it makes you less aware of your surroundings. Have your keys in your hand when you reach your home or car. Conceal your money and jewelry. If you decide to take someone home, introduce him or her to a friend or acquaintance, so someone sees the person with whom you leave.
Harassment is often a prelude to an assault.
If you decide to answer back, do so from a safe distance and be prepared to run or fight.