This summary is not the rule. The rule text controls.
If you do something disrespectful or disruptive right in front of a judge, like yelling in the courtroom or refusing to follow the judge's orders during a hearing, the judge can punish you for contempt right away. You don't get a full trial for this kind of contempt because the judge already saw what happened.
Before the judge punishes you, though, you get a chance to speak up. You can explain your side of the story or give reasons why you shouldn't be punished as harshly. The judge has to listen to you before deciding on any punishment.
Once the judge decides, they have to write up an official order. This order needs to explain exactly what you did that counted as contempt, state clearly that you were found guilty of it, and spell out what your punishment will be. This paperwork protects you by creating a clear record of what happened and why, which matters if you ever want to appeal the decision.