On cross-examination, lawyers are allowed to ask leading questions. They typically ask narrow questions intended to force the witness to provide certain information. Prosecutors use this tactic, too.
Of course, defendants and their witnesses must testify truthfully at all times. But they must be careful to avoid going along with misleading information in a prosecutor's leading questions. For example, if a defense witness's story is that an incident occurred "at dusk," the witness shouldn't meekly go along with the prosecutor's question: "It was really dark out there, wasn't it?" If it wasn't that dark out, the witness should answer, "No."
To be sure that they testify as truthfully and accurately during a hostile cross-examination as during friendly direct questioning, defendants and their witnesses should:
A witness who isn't able to answer a question should communicate that. For example, a witness who doesn't have personal knowledge should say, "I don't know" rather than guess at an answer. And a witness who has to qualify a "yes" or "no" to make it accurate should say something to the effect of, "Your Honor, I can answer that question only if I'm allowed to explain my answer." Even if the witness doesn't get to elaborate on cross-examination, the defense attorney can usually provide that opportunity on re-direct examination.
Example. Jesse James is on trial for armed robbery. After witness Kit Carson testifies and identifies James as the robber, defense counsel cross-examines him. The lawyer asks, "you had drunk three whiskeys within a half hour of entering the store, right?" The question is leading but proper. The theory is that since Carson is likely to be hostile to the cross-examiner, he won't agree if the information is false. If Carson had two whiskeys—not three—within the half hour in question, he would simply answer, "No."