I saw a presentation once by a legendary trial attorney from Chicago. He talked about how to handle exactly this situation. He said you ask the judge to instruct the witness as a last resort, but that you as the attorney should first try repeating the question:
Attorney: “You didn’t actually see my client at the crime scene, that night did you?”
Witness: “Well, I heard his voice, and I’ve known him for a long time, so I can definitely recognize it. I must have talked with him a thousand times. So I know he was there.”
Attorney: [pause. stays very calm.] “Mr. Smith, you didn’t actually see him that night did you?”
Witness: “Well, like I told you, I heard his voice. I know he was there, just like I know I am sitting in this Courtroom and I know two plus two is four.”
Attorney: [long pause, then speaking very very slowly with hands on thighs, leaning forward toward witness, with slight, VERY slight hint of exasperation in his voice]" You. did. not. see. him. that. night."
Witness: “No. I did not see him”
Attorney: "Thank you. [pause. then continue to next question]. And then you ran downstairs and the police were already there when you go there, correct?.. "
Now, if the witness will not answer the question on the third try, you turn to the judge and say
“Your honor, I’m asking a question with a yes or no answer, and I think we all deserve a yes or no answer.”
And then let the judge admonish the witness. But you as the attorney only ask the judge to intervene after you’ve tried a few times to get a straight answer.
One very important aspect of this technique is that it actually hammers away–properly–on exactly the point that the attorney is trying to make with the question: that the witness did not SEE the defendant. Maybe the witness DID hear him. Maybe the witness is ABSOLUTELY CORRECT that the defendant was there. But he did not see the defendant, and the attorney is entitled to bring out that point. Now, if the witness just answers “no I did not” then the point is much less emphasized for the jury.