God wants you to ask. He really does. But there are some conditions He gives in order to answer your requests. In John chapters 14-16 we find a number of these conditions.We need to remember that these are Jesus' last hours with the disciples; and He wants them to understand how prayer really works. Over and over He emphasizes the need to ask, but His answers will be based on three conditions.
First, in John 14:13, Jesus says your request must glorify God,
"And whatever you ask in My name, that I will do, that the Father may be glorified in the Son. If you ask anything in My name, I will do it."
Second, in John 15:7, He says your request must be consistent and in harmony with His Word,
"If you abide in Me, and My words abide in you, you will ask what you desire, and it shall be done for you."
And finally, in John 16:23-24, Jesus sets the condition that your request bring you joy,
"And in that day you will ask Me nothing. Most assuredly, I say to you, whatever you ask the Father in My name He will give you. Until now you have asked nothing in My name. Ask, and you will receive, that your joy may be full."
Over and over, Jesus commands you to ask. But when you ask, make sure your request will glorify God, that it is consistent with His Word, and that it will bring you joy.