Assalam O Alaikum WaRahmatullahi WaBarakatuh,
First of all when these people mock Allah and His prophets, they only harm themselves out of their ignorance. Their mocking does not decrease Allah’s Might and nor does it decrease the honor of our Prophet peace be upon him.
Second, people who mock Islam normally want us to react. And it’s best to either answer their bad words with something better or simply to ignore them. This is the advice we find in Quran:
Al-A'raf 7:199
خُذِ ٱلْعَفْوَ وَأْمُرْ بِٱلْعُرْفِ وَأَعْرِضْ عَنِ ٱلْجَٰهِلِينَ
English - Mohsin Khan/Taqi-ud-Din al-Hilali
Show forgiveness, enjoin what is good, and turn away from the foolish.
Al-Furqan 25:63
وَعِبَادُ ٱلرَّحْمَٰنِ ٱلَّذِينَ يَمْشُونَ عَلَى ٱلْأَرْضِ هَوْنًا وَإِذَا خَاطَبَهُمُ ٱلْجَٰهِلُونَ قَالُوا۟ سَلَٰمًا
English - Mohsin Khan/Taqi-ud-Din al-Hilali
And the slaves of the Most Beneficent (Allah) are those who walk on the earth in humility and sedateness, and when the foolish address them (with bad words) they reply back with mild words of gentleness.
Fussilat 41:34
وَلَا تَسْتَوِى ٱلْحَسَنَةُ وَلَا ٱلسَّيِّئَةُۚ ٱدْفَعْ بِٱلَّتِى هِىَ أَحْسَنُ فَإِذَا ٱلَّذِى بَيْنَكَ وَبَيْنَهُۥ عَدَٰوَةٌ كَأَنَّهُۥ وَلِىٌّ حَمِيمٌ
English - Mohsin Khan/Taqi-ud-Din al-Hilali
The good deed and the evil deed cannot be equal. Repel (the evil) with one which is better (i.e. Allah ordered the faithful believers to be patient at the time of anger, and to excuse those who treat them badly), then verily! he, between whom and you there was enmity, (will become) as though he was a close friend.
And Allah knows the best!
Ma’aSalaam