This may depend on the style of your lawyer. Some lawyers prefer to use the court system to establish initial orders and gather facts before using the mediation process. Some lawyers find that starting mediation early in the case helps keep the conflict and costs down.
If you have a choice, Angeles Mediation recommends starting mediation at the very beginning of the case, before the adversarial nature of the court system causes things to spin out of control. Finding information necessary to resolve the case and establishing court orders, or rules between the parties (such as parenting time and child support), can be a part of the mediation process. This can be done with or without lawyers for both parties. Mediating early typically reduces the cost of legal fees dramatically.
If your case has already been going on and things have heated up, mediation can still be effective at resolving your disputes. This is what mediators are trained for.