When the chief priests and elders of the Jews confronted Jesus and challenged His authority, He refused to tell them (Matthew 21:23-27). Instead, He told the parable of two sons.
"But what do you think? A man had two sons, and he came to the first and said, 'Son, go, work today in my vineyard.' He answered and said, 'I will not,' but afterward he regretted it and went. Then he came to the second and said likewise. And he answered and said, 'I go, sir,' but he did not go. Which of the two did the will of his father?" (Matthew 21:28-31)
The first refused to do what his father said but later repented and obeyed. The second son said he would obey his father but did not obey.
The leaders of the people correctly identified the first son as the one who did the father’s will. Jesus then applied the point of the parable to them.
Jesus said to them, "Assuredly, I say to you that tax collectors and harlots enter the kingdom of God before you. For John came to you in the way of righteousness, and you did not believe him; but tax collectors and harlots believed him; and when you saw it, you did not afterward relent and believe him.” (Matthew 21:31-32)
The tax collectors and harlots had made decisions that essentially told the Father, “I won’t obey you.” However, they repented at the preaching of John (Matthew 3:4).
The chief priests and rulers of the people claimed to obey God, but they refused to believe the message of John and repent (Matthew 3:7-12).
Those who do the will of the Father hear the Word of God, believe it, and obey.
“So then faith comes by hearing, and hearing by the word of God.” (Romans 10:17)
“though He was a Son, yet He learned obedience by the things which He suffered. And having been perfected, He became the author of eternal salvation to all who obey Him.” (Hebrews 5:8-9)