7 Nevertheless I tell you the truth; It is expedient for you that I go away: for if I go not away, the Comforter will not come unto you; but if I depart, I will send him unto you.
8 And when he is come, he will reprove the world of sin, and of righteousness, and of judgment:
9 Of sin, because they believe not on me;
10 Of righteousness, because I go to my Father, and ye see me no more;
11 Of judgment, because the prince of this world is judged.
12 I have yet many things to say unto you, but ye cannot bear them now.
13 Howbeit when he, the Spirit of truth, is come, he will guide you into all truth: for he shall not speak of himself; but whatsoever he shall hear, that shall he speak: and he will shew you things to come. John16:7-13
Muhammed guide us into all truth.
Muhammed conveyed what will happen in the future.
Muhammed did not speak of Himself but He speak of whatsoever he hear. That statements explain the way which revelation come to Muhammed.
2-Your companion [Muhammad] has not strayed, nor has he erred,
3-Nor does he speak from [his own] inclination.
4-It is not but a revelation revealed, An-Najm(53):2-4
Muhammed heard revelation from Gabriel and got written through Sahabas.