A du'a with nobody listening
Surah Maryam opens with him: When he called to his Lord a private supplication (19:3). The word used means hidden, low, out of earshot.
That detail is the reason to tell this story. He was not making a point in front of anybody. There was no audience and no benefit to being seen. He wanted something, and he asked for it where only Allah could hear.
And he was completely honest about the odds: My Lord, indeed my bones have weakened, and my head has filled with white, and never have I been in my supplication to You, my Lord, unhappy (19:4). Then, in Surah al-Anbiya, the same request put another way: My Lord, do not leave me alone, while You are the best of inheritors (21:89).
The answer, and the ordinary question
He was answered immediately and by name: O Zakariya, indeed We give you good tidings of a boy whose name will be Yahya. We have not assigned to any before this name (19:7).
And then he asks the question anyone would ask: My Lord, how will I have a boy when my wife has been barren and I have reached extreme old age? (19:8).
He is not rebuked for it. The answer is: Thus it will be; your Lord says, It is easy for Me, for I created you before, while you were nothing (19:9).
In Surah Al 'Imran the same scene has a beautiful setting. The angels call to him while he is standing in prayer in the chamber (3:39), and just before it, the Quran explains where the idea came from: he had seen provision with Maryam, asked her where it was from, been told it was from Allah — and it was there that he prayed to his Lord (3:37-38). Seeing what Allah had done for someone else made him ask for himself.
Three days without speaking
He asked for a sign, and was given one: Your sign is that you will not speak to the people for three nights, sound (19:10) — that is, with nothing wrong with him.
So he came out to his people from the prayer chamber and signalled to them to exalt Allah morning and afternoon (19:11).
It is a gentle ending. A man who had asked quietly was given a sign that made him quiet, and the only thing he could still communicate was that they should praise Allah.