Yes. You can get a restraining order, which requires your ex to stay a certain distance away from you at all times, and you can make sure that the places you frequent, such as your home, workplace, or school, are included in the order. In many states, your employer may be able to get its own restraining order to keep your ex off the premises. There are also some commonsense safety precautions you can take at work, such as making sure no one gives out information on your presence or whereabouts. For more information, see Nolo's article Workplace Violence: Understand and Avoid It.