Have you ever consciously thought about questions? For longer than a few seconds? A good question or questioning session is not accidental.
You are asking a question for which you do not have the answer or for an existing thought you want confirmed. Else, why waste someone’s time?
You are asking a question to a more important person only because you have tried to answer it already using other resources and the cost benefit analysis indicates that it is time to impose yourself on someone else. You do not want to ask someone to do your job who should not be doing your job; especially your boss.
You hope that the person you are asking can or will actually answer the questions. There is no real point asking a question that cannot be answered just to show how smart you are unless you are specifically probing to see what can or cannot be answered.
You hope that you have the skill to understand the answers (immediately or eventually). Why seek an answer you cannot use?
You hope that you are asking questions that require a reasonable amount of effort from the person you are asking the questions of. If answering requires too much effort, they might not answer, or answer appropriately. If it is too little effort, it is likely that you could have answered it yourself.
You hope that you ask questions that help identify, clarify, or eliminate some part of the puzzle. There should be a clear purpose to the question. You are trying to get by some kind of barrier - make sure you know what the barrier is and focus on it.
If you have a limited time or a limited number of questions, you hope you are asking the most important and the most relevant questions in the right order. Consciously think about priorities.
You have thought about the questions and possible answers in advance, so that you hope you can ask intelligent and useful questions once the person gives you an answer. But not too much thinking as you want to avoid bias and you want to avoid turning off your ears. You want to be open to listening and reformulating your questions and plan!
There are rhetorical questions which have no expected answer, but can cause the other person to think and provide other knowledge. In general, you should minimize the types of rhetorical questions where you answer yourself! Note: there are cases where rhetorical questions can be used to voice your observations and have the other person comment upon them, but this usage should not be the norm.
Not all questions are created equal.
There is a large, possible solution space, and these best questions will help you focus on reasonable portions of the solution space and be effective and efficient in your questioning. It is also important to consider the context or environment within which you are asking the question - casual, formal, private, others in attendance, etc.