Unfortunately, at the beginning of a divorce case, it is sometimes necessary to have a spouse removed from the family home. This would most typically be in a high conflict divorce where the other spouse has some history of domestic violence.
If a divorce case has not yet been filed, but the home situation has deteriorated to the point where you feel you are in danger, you can file for a Domestic Violence Order for Protection (DVOP). Typically this would be based on either threats or actual acts of domestic violence has taken place.
Generally, a DVOP will be issued immediately without notice to the other spouse, but the order is only good for a short period, typically 14 days. The court will also set a hearing no more than 14 days out, at which hearing the other spouse will have an opportunity to appear and tell their side of the story. At this hearing, the court will decide whether to make an Order for Protection for a longer period of time.
If you have filed your divorce case, you can instead file a motion for an Immediate Restraining Order. This also can be heard right away without notice to the other spouse if that is necessary to provide safety.
Similar to a DVOP, the immediate order will be for a short period, with a hearing scheduled a few weeks out to allow the other party to appear and the court to decide whether the orders should be continued. The scope of the order can be broader than a DVOP, as it can also deal with assets, restraining the other spouse from disposing of property, emptying accounts, changing insurance policies, etc.
The second hearing after the Immediate Restraining Order has been issued is the temporary order hearing. At this hearing, the court is deciding what orders should be in place until final orders are entered in the case (after trial or agreed final orders).
Their orders may include restraints, but may also address other issues like spousal support, child support, parenting, use of property, payment of debts, etc. Even if there has not been domestic violence warranting a DVOP or an Immediate Restraining Order, you may still request a temporary order requiring the spouses to live in separate residences based on lesser concerns such as conflict short of domestic violence that will still create problems for the parties or children.