You have a right to challenge a court's closure of a proceeding that you wish to attend. How you go about challenging such a closure will depend on whether you are present in the courtroom at the time the judge orders closure or whether you find out about it after the fact.
Responding to Closure Orders on the Spot
You may be in attendance when a judge orders everyone to leave the courtroom unless they are associated with the case. Ask for the judge's permission to speak. If the judge allows you to speak, you should politely object to the closure and ask that your objection be noted on the record. Ask the judge for an opportunity present your arguments against closure, and time to prepare your arguments and/or get legal representation.
If the judge will not allow you to speak, leave the courtroom. Do not raise your voice and make a scene; disturbing the decorum of a courtroom will very likely have negative consequences. Once you're out of the courtroom, you should quickly draft a letter to the judge informing her that you object to the closure and that you plan on filing a motion in opposition to the closure. Ask court personnel to deliver the note to the judge. You will need to find legal assistance immediately in order to determine how best to proceed.
The First Amendment Project provide a good set of steps to handle closures in person. Although the steps are geared specifically toward California courts, most of the information applies to courts nationwide (you should research relevant cases or legislation in your jurisdiction, if necessary).
Responding to Closure Orders After the Fact
Alternatively, you may find out after the fact that a court closed a proceeding. If this is the case, go to the clerk's office and ask whether the judge explained her reasons for closure. You will likely need legal assistance in finding the correct laws to support your argument that the proceeding should never have been closed in the first place. If you believe that the proceeding was improperly closed, you can try to get a copy of the transcript from the proceeding. Get legal assistance to determine how best to proceed.
For more information, consult the Reporters Committee for Freedom of the Press, which has a useful guide on how to proceed in these cases.