Are you thinking of Num 20:8 where God said to Moses: "Speak ye unto the ROCK before their eyes; and it shall give forth HIS water."
Yes.
Now please answer the question.
What was it that the Lord asked Moses to do, and what was it Moses did, that caused the Lord to say these words to him.,.,
Because you did not believe Me, to hallow Me in the eyes of the children of Israel...
Here is the context -
7 Then the Lord spoke to Moses, saying, 8 “Take the rod; you and your brother Aaron gather the congregation together. Speak to the rock before their eyes, and it will yield its water; thus you shall bring water for them out of the rock, and give drink to the congregation and their animals.” 9 So Moses took the rod from before the Lord as He commanded him.
10 And Moses and Aaron gathered the assembly together before the rock; and he said to them, “Hear now, you rebels! Must we bring water for you out of this rock?” 11 Then Moses lifted his hand and struck the rock twice with his rod; and water came out abundantly, and the congregation and their animals drank.
12 Then the Lord spoke to Moses and Aaron, “Because you did not believe Me, to hallow Me in the eyes of the children of Israel, therefore you shall not bring this assembly into the land which I have given them.”
13 This was the water of Meribah, because the children of Israel contended with the Lord, and He was hallowed among them.
Deuteronomy 20:7-13
JLB