sheriff or judge
The Sheriff is the name for a judge in the sheriff court.

The sheriff or judge is in charge of all court proceedings and is an expert in the law.

He or she will ensure everything is done fairly within the law and that the court rules and legal proceedings are followed.

They also have a duty to protect the interests of all the people involved in the case including the witnesses.