Yes !!! I have had a restraining order successfully put on someone . Firstly you have to phisically go to the Guardia Civil and make a statement to them. They will ask you for all the details of the person you want to put a restraining order on and the details why. Its basically called a denucia. They will take your statement and serve the person with the denucia. Within a week you will have a court date,normally 1 month after the complaint. You will need a lawyer!! The judge will then listen a read your statement and decide what action to take .
Good luck
Not to nitpick, but it’s actually called “denuncia” and it’s not a specific process… it refers to the act of reporting a crime to the police. For instance, reporting your car stolen is a denuncia as well. 😊