If you have been arrested by the immigration authorities, or your case has been referred to immigration court (the "EOIR") after an application that you submitted was rejected, your first hearing will simply be a brief meeting with the judge, called a "Master Calendar" hearing. There, the judge will quickly look at what kind of case you have, and set a date for the "real" hearing of your case, called a merits hearing.
You are no doubt nervous about what you will encounter. Here are the most important things to keep in mind or prepare for in order to hopefully defend against your removal from the United States.
Unfortunately, you'll have to pay for your own attorney. You may be able to find one who offers low-cost services, however, if your income is low. The court itself can give you a list, or you can talk to local nonprofit organizations serving immigrants, such as Catholic Charities, the International Institutes, and so forth. If you don't have an attorney at the Master Calendar hearing, you may be lucky enough to find a volunteer one already in the courtroom, who will help you on that day. But it's far better to line up your own attorney ahead of time.
The worst thing you can possibly do is fail to show up for your hearing. If you do that, an order of removal will be automatically entered, and you'll be expected to leave the country right away. Far better to talk to an attorney about whether you have a defense to your case. Many people succeed on an application after the judge has heard the case, even if their earlier application was denied, such as for asylum or a green card. And if you lose at your merits hearing, you'll have a right to appeal.
During the hearing, you will be expected to present your defense and fully show why you deserve the relief you are requesting, such as a green card. Your attorney can present testimony from witnesses, and submit any documents or exhibits that will support your case. You will likely want to testify, with your attorney asking the questions. In any case, the attorney for the government, as well as the judge, are likely to ask you questions.
If you are able to comfortably testify in English, it will make your hearing go faster. But if you're more comfortable in another language, it's much safer to ask for an interpreter, which the government will provide.
It is recommended that you wear a suit and tie, if possible, or at least clean, neat, and comfortable clothes. Part of the judge's decision may rest on whether he or she believes your testimony, and looking professional can help you appear credible.
It is a good idea to leave young children at home, as the hearing can take three to four hours to complete. Many merits hearings don't finish on the first day. In that case, the judge will "continue" the hearing to another day -- often far into the future, because the court calendars tend to get quite booked up.
If you need to attend an immigration court hearing, you should absolutely speak with a lawyer to help you determine your rights, figure out a defense strategy, and prepare you to testify. Immigration law is hugely complicated, but you may have a chance at a U.S. green card that you haven't even heard about.