Those who attend the Friday prayer should be silent and listen attentively to the Imam when he is preaching. It is not permissible to speak to others, even if that is to tell them to be quiet.
It was narrated from 'Abdullah bin Ibrahim bin Qariz and Sa'eed bin
Al-Musayyab that: Abu Hurairah said: "I heard the Messenger of Allah
(ﷺ) say: 'If you say to your companion: Listen attentively on a Friday
when the Imam is delivering the khutbah, then you have engaged in idle
talk.'"
Sunan an-Nasa'i (Book 14, Hadith 1413)
and
Abu Huraira reported Allah's Messenger (ﷺ) as saying:
If you (even) ask your companion to be quiet on Friday while the Imam
is delivering the sermon, you have in fact talked irrelevance.
Sahih Muslim (Book 7, Hadith 15)
Even if it relates to a good deed or some Islamic inquiry:
‘Ata’ bin Yasar narrated from Ubayy bin Ka’b: “The Messenger of Allah
(ﷺ) recited Tabarak [Al-Mulk (67)] one Friday, while he was standing
and reminding us of the Days of Allah (i.e., preaching to us). Abu
Darda’ or Abu Dharr raised an eyebrow at me and said: ‘When was this
Surah revealed? For I have not heard it before now.’ He (Ubayy)
gestured to him that he should remain silent. When they finished, he
said: ‘I asked you when this Surah was revealed and you did not answer
me.” Ubayy said: ‘You have gained nothing from your prayer today
except the idle talk that you engaged in.’ He went to the Prophet (ﷺ)
and told him about that, and what Ubayy had said to him. The Messenger
of Allah (ﷺ) said: ‘Ubayy spoke the truth.’
Sunan Ibn Majah (Book 5, Hadith 1165)
According to the majority of the Ulema, the reason for this prohibition is that listening to the Friday prayer sermon is obligatory, as it takes the place of two of the rakahs of the noon prayer, so things offensive during the prayer are offensive while listening to the sermon.
Also please note that an exception is made from that in the case of speaking to the Imam, or the Imam speaking to the worshippers for some important reason.
Narrated Anas bin Malik:
In the lifetime of Allah's Messenger (ﷺ) (p.b.u.h) the people were
afflicted with a (famine) year. While the Prophet was delivering the
Khutba (sermon) on the pulpit on a Friday, a Bedouin stood up and
said, "O Allah's Messenger (ﷺ)! The livestock are dying and the
families (offspring) are hungry: please pray to Allah to bless us with
rain." Allah's Messenger (ﷺ) raised both his hands towards the sky and
at that time there was not a trace of cloud in they sky. Then the
clouds started gathering like mountains. Before he got down from the
pulpit I saw rainwater trickling down his beard. It rained that day,
the next day, the third day, the fourth day and till the next Friday,
when the same Bedouin or some other person stood up (during the Friday
Khutba) and said, "O Allah's Messenger (ﷺ)! The houses have collapsed
and the livestock are drowned. Please invoke Allah for us." So Allah's
Messenger (ﷺ) raised both his hands and said, "O Allah! Around us and
not on us." Whichever side the Prophet (ﷺ) directed his hand, the
clouds dispersed from there till a hole (in the clouds) was formed
over Medina. The valley of Qanat remained flowing (with water) for one
month and none, came from outside who didn't talk about the abundant
rain.
Sahih al-Bukhari (Book 15, Hadith 28)
Thus those who attend Friday prayers have to be silent and listen attentively to the Imam. It is not permissible to speak whilst the Imam is delivering the khutbah, except in cases of necessity such as saving a blind man from falling or if the khateeb makes a mistake in reciting a verse that alters the meaning, or if he omits a phrase from a verse or some other reasons in which the Imam may speak for a purpose include problems with the loudspeakers, in which the imam may speak to the engineer and ask him to see what is wrong.
Based on how you frame your question, I assume you didn't have the intention to make a mistake. In Islam all actions are based on your niyah. Inshallah, Allah will bless you with His Mercy.
But now that you know what is the etiquette, inshallah you will also be more attentive and careful I hope :)
Salaam!
References:
https://islamqa.info/en/45651