If you are worried about leaving the court building because you might be abused or intimidated by the other party on the way home, you can wait in the court building for a short period of time until they have left the building. If you explain the situation, court security staff may try and let you know when the coast is clear. In some courts there is a side or back exit that court staff will arrange for you to use if you are worried. Even though the hearing is private it is fine to travel to and from court with a friend or family member who can wait in the court building whilst the hearing is going on.
Once you have left the Court building you should contact the Police immediately if someone is following, intimidating or threatening you.