How do you object in court?
In court, you (if you are one of the attorneys involved in a given case) object by telling the judge that you object. The judge will then rule on your objection, either sustaining it or overruling it.
In our legal system, there are many reasons why an attorney might make an objection. They might object that the opposing attorney is asking a witness leading questions on direct examination. They might object that the other attorney’s question to a witness is argumentative, meaning that it is not so much a question as an argument. They might say that the opposing attorney is asking their witness to speculate or to guess at something rather than simply stating things they know to be true. There are many other grounds for objection. A list of possible objections can be found by clicking a link within the link below.
In order to object, a lawyer simply has to tell the judge that they object as soon as the objectionable question has been asked or the objectionable statement made. The judge may require the attorney to specify the grounds on which they are objecting. The judge then rules on whether the objection will be upheld.
I should also add that most judges are extremely annoyed when one objects without immediately stating the basis of the objection. I remember learning that in law school and seeing it borne out time after time in court. An attorney who got up and simply said "I object" was often the object of the judge's ridicule. This is as it should be, actually, since there is a transcript being made, and a judge's ruling on an objection could very well be the basis for an appeal, not necessarily an interlocutory appeal, on just that ruling, but as the basis for an appeal after a decision has been made at the end of trial. Thus, an attorney always wants to say "I object on the grounds that...," stating clearly what those grounds are, preserving the issue for a possible appeal.