A person who has been assaulted or threatened by his or her spouse/partner can ask the court for a restraining order. The restraining order may say that your spouse/partner has to stay away from you, or it can be more specific and say that your spouse/partner must not come to your home, to your place of work, to your children's school, or to other places where you often go (your place of worship, or your parent's home, for example).
If your spouse/partner disobeys the restraining order, you have to call the police. The police will want to see the restraining order so you should keep it with you at all times. Your spouse/partner can be arrested and charged with a crime if the police believe that he/she has disobeyed the restraining order.
Usually one applies for restraining order as part of a larger court proceeding, but it is possible to apply for a restraining order alone. The process can take many months. It will require a formal submission, evidence, and a hearing at which both sides can make their claims.
In some circumstances, a person who fears for her/his immediate safety can ask the court for an “ex parte restraining order”. In such a case, your ex-partner is not notified of the application, and the judge can issue the order immediately. This type of order is usually short lived, just to allow you to be safe while your ex-partner is notified and given the opportunity to tell his or her side of the story.