All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
A Muslim is not allowed to worship Allaah except in the way prescribed by the Prophet, sallallaahu ‘alayhi wa sallam. Jaabir said that the Prophet, sallallaahu ‘alayhi wa sallam, said:
I swear by the One in Whose Hands my soul is! If Moosa (Moses) were to appear among you, and you (my followers) came to follow him instead of following me, you would stray from the straight path. If he (Moosa) lived to see my prophethood, he would definitely have followed me. [Ad-Darimi and Ahmad]
There is no evidence that seeking Allaah’s favor through silence is part of what the Prophet, sallallaahu ‘alayhi wa sallam, has prescribed. In fact, it has been reported that a man from among the companions of the Prophet, sallallaahu ‘alayhi wa sallam, who was known as Abu Israa’eel took a vow to keep standing, not sit down, not rest in the shade, not speak, and fast. Having heard of this, the Prophet, sallallaahu ‘alayhi wa sallam, said: “Let this man speak, take rest in the shade, sit down, and complete his fast.” [Al-Bukhari and others] Commenting on this hadith, Ibn Hajar said in Fat-h Al-Baari: “The hadith indicates that abstaining from permissible speech is not a form of obedience to Allaah.”
This is the case if a person abstains from speaking to emulate Prophet Zakariyya or draw nearer to Allaah by way of giving up permissible speech. However, if a person remains silent in compliance with the directive of the Prophet, sallallaahu ‘alayhi wa sallam, who was quoted by Abu Hurayrah as having said: “Whoever believes in Allaah and the Day of the Judgment, let him say that which is good or remain silent,” then, in this case, his silence is considered a great act of worship for which the Muslim will be rewarded, Allaah willing.
Finally, it is worth noting that Prophet Zakariyya’s abstinance from speaking was not an act of worship. Rather, it was a sign and evidence from Allaah of the pregnancy of his wife. Allaah says (what means): {He said, My Lord, make for me a sign. He Said, Your sign is that you will not [be able to] speak to the people for three days except by gesture.} [Quran 3: 41]
Allaah Knows best.