Judges generally try to help you resolve your case before the trial date, but that is often simply impossible. If, after months and even years of negotiations, conferences, and motions, you and your spouse or ex-spouse still have not reached an agreement, your last recourse is to have a trial. The trial gives the judge the opportunity to hear both parties' wish lists, substantiated by volumes of documents, possibly witnesses, and any other information the contenders think will persuade the judge in their favor.
After the judge ponders all this, she will make her decision. Because the judge has heard all the evidence and witnesses, a decision made by the judge at the trial's conclusion is taken very seriously by the powers that be. This decision should put an end to motions and conferences called for modifying temporary orders or changes in visitation schedules without a change in circumstance. Everyone has spent a lot of time, money, and effort at the trial, and asking for subsequent modification might not do you much good, unless there's been a substantial change in circumstances that would warrant modification after the fact.
Your trial will be very much like those you've seen on television and in movies. If you are the plaintiff, or petitioner—the spouse who started the action—your lawyer presents your case first. He will probably call you to the witness stand, where you will be sworn in and asked to take a seat. After your lawyer has finished asking you questions (direct examination), your spouse's lawyer has the opportunity to ask you questions (cross-examination). Your lawyer has the right to object to improper questions, so give her time to do that before answering. It's also a good idea to take a moment before you answer to collect your thoughts.
It is certainly possible for the pro se litigant to represent himself or herself at trial—but if there is enough at stake for you to get to this point, you might do best with a lawyer involved.
A guardian ad litem is a person, often a lawyer, but in some states a psychologist or social worker, selected by the judge and assigned to represent “the best interests” of the children. Some states do not have guardians ad litem.
After the cross-examination, your lawyer can ask you questions again; maybe your spouse's lawyer interrupted you while you were trying to explain something. Your lawyer can now give you the chance to present your explanation (your re-direct examination).
After your re-direct examination, there can be a re-cross-examination. The questioning can go back and forth for as long as the judge will allow it. When there are no more questions for you, your lawyer can call a witness to the stand on your behalf, and the whole process starts all over again.
After you have presented all your witnesses (in divorce cases, it's often just you, your spouse, possibly your child's guardian ad litem, the court-appointed psychiatric evaluator, and expert witnesses such as an appraiser of real property or of a business), your side “rests.” It is now your spouse's turn to present his witnesses. The same questioning occurs, only the roles are reversed. Your spouse's lawyer conducts the direct questioning, and your lawyer cross-examines the witness.
After your spouse (in this case, the defendant) presents her witnesses, your lawyer can call witnesses to refute what's been said (called rebuttal witnesses). After you've called your rebuttal witnesses, your spouse can do the same.
It is the rare pro se litigant who has enough skill and experience to question an expert witness hired by the other side. When both sides have rested, the judge might allow each attorney (or if there are no attorneys, the spouses themselves) to make a short, closing speech. Alternatively, he might ask that memoranda be submitted to him by a certain deadline. Sometime later, he makes his decision, usually in writing.
If your trial was by jury, the jury decides the outcome after all the witnesses have testified, closing speeches have been made, and the judge has instructed the jurors about their responsibilities.
Some judges might give you a “bench” (oral) decision at the end of your motion or trial, as though you had a jury. (You or your lawyer should be able to find out, before the trial, if your judge makes bench decisions.)
Trials can be as short as half a day or as long as several months (although that would probably be unusual for a divorce trial). The length of a trial depends on the number of witnesses, how long each examination takes, and what motions are made during the course of the trial. The emotional and financial costs rapidly add up.