Jn 6:38
38 For I came down from heaven, not to do mine own will, but the will of him that sent me.
Jesus here makes it plain as to why He came down from Heaven, it was to do His Father's and God will, the same will in Heb 10:7,9-10
7 Then said I, Lo, I come (in the volume of the book it is written of me,) to do thy will, O God.
9 Then said he, Lo, I come to do thy will, O God. He taketh away the first, that he may establish the second.
10 By the which will we are sanctified through the offering of the body of Jesus Christ once for all.
This lets us know that before He came down from heaven, He knew it had to do with His previous Suretyship engagement, to be an Offering for sin Isa 53:10
10 Yet it pleased the Lord to bruise him; he hath put him to grief: when thou shalt make his soul an offering for sin, he shall see his seed, he shall prolong his days, and the pleasure of the Lord shall prosper in his hand.
Thats the Offering in Heb 10:10,14 ! So all the time before His coming into the world, the sins of those He was charged with, were never charged to them, a whole World of men 2 Cor 5:19
19 To wit, that God was in Christ, reconciling the world unto himself, not imputing their trespasses unto them; and hath committed unto us the word of reconciliation.
Those whom Christ had been charged with their sins,they never legally by God, had them charged to them, which makes them even before the Incarnation, legally Justified, Acquitted from them, and the condemnation of them, even too, when they are dead in trespasses and sins they are Acquitted before God of all sin ! All this is True from the fact that In the Eternal Purpose of Christ, before the foundation, He was already slain by Eternal Decree, which means that God had already determined that Christ should die in their stead for their sin and condemnation, making them free from all condemnation !