A restraining order is a court order that is used to prohibit someone from doing something, or in the alternative, forcing someone to do something. Generally they are called “emergency orders” because often it physical violence, harassment or some other kind of conduct that must be stopped immediately.
It’s an urgent matter that won’t wait for the normal course of the court system where you file a motion and go to court and have a hearing. In the case of an emergency order, it is something that must be dealt with in a manner of hours or days rather than weeks.
Normally a restraining order is for conduct that needs to be “restrained.” For example, someone may be sending menacing text messages or emails, threatening phone calls, or otherwise harassing someone to disrupt their peace of mind. But restraining orders can also be expanded to forcing someone to not spend money, for example in the case where one of the parties to a divorce is using the credit card of the other spouse.
Whatever negative behavior that needs to be immediately dealt with would be what a restraining order would be used for.