If you cannot agree with your spouse on all issues, then a judge will hold a trial and listen to both of you and your witnesses and then make a decision.
The divorce case is started by filing a lawsuit at the courthouse once you have grounds for divorce and meet the residency requirements. Then the lawsuit is served on your spouse who must answer it. There is a period of discovery and a trial where the judge listens to testimony and other evidence in order to resolve your case.
The issues in divorce cases can include:
The parties to the divorce can settle all of these issues by agreement without going to court. Or they can decline to settle and leave it up to the judge.