The following paragraphs are from Hugh Martin's classic: The Shadow of Calvary. This is a very profound book. The paragraphs I have transcribed here deal with the Father's answer to Christ's prayer in Gethsemane, "Thy will be done."
We must bear in mind that the ultimate agony of Christ's prayer consisted of a burning and unquencable desire that the will of God might be done. "O my Father, Thy will be done." And this will of God embraced immediately and ditrectly these two objects: first, that Jesus should offer Himself a sacrifice of a sweet-smelling savour to God; and secondly, that herein He should be an effectual and accepted ransom securing the redemption if those whom the Father hath given to Him. The first part of this will of God, namely, the offering of the body of Christ once for all, is asserted in the well-known passage: "Sacrifice and offering thou wouldst not, but a body thou hast prepared me; in burnt offerings and sacrifices for sin thou hast no pleasure. Then said I,lo! I come to do thy will, O God" (Heb.10:5-7) And the second part of God's will, namely, our separation and consecration to God, and thereby also our salvation, as the fruit of Christ's death and sacrifice, is set forth in close connection with this in a subsequent verse, when the apostle says, "By th which will we are sanctified through the offering of the body of Christ once for all" (Heb. 10:10). Hence when the apostle describes His anguish of prayer in Gethsemane in these terms, "In the days of his flesh, he offered up suplications with strong crying and tears unto him that was able to save him from death," and wheh he assures us that His prayer was heard and answered "in that he feared" (Heb. 10:7); he proceeds to show that it was precisely in these two points that the answer to His prayer consisted; first, that He might receive all needed grace to be "obedient unto death," positively offering Himself a sacrifice; for this was that will of God which He came to do: and, secondly, that all His sheep, His children, the travail of His soul, might be secured unto eternal salvation. For unquestionably in these respects would the aposlte have us to understand that He was "heard in that he feared;" namely, first, inasmuch as "though he were a Son he learned obedience by the things which he suffered" (verse 8), being made perfect in His function as a high priest, not by mere passive obedience, which is the duty of a priest, and especially of such a priest as Jesus, to offer Himself without spot unto God. And then, secondly, the will of God being thus performed by Jesus, the sanctification or salvation of His people is also given to Him; for being thus "made perfect he became the author of eternal salvation to all them that obey him" (verse 9).
Such are the two objects of God's will, the two corresponding elements of Christ's prayer, and the two-fold and complete answer. They embrace indeed, and briefly represent, the grand will and purpose of God in the everlasting covenant, consisting, as they really do, of the mutual pledge between the Father and the Son; first, on the part of the Son to the Father, that He should be obedient unto death, the ransom and the righteousness of the Church; and secondly, on the Father's part to the Son, that He should indeed see the travail of His soul, and that the Church in all her members should be ransomed and made the righteousness of God in Him for ever.
Hugh Martin, The Shadow of Calvary, Ch. 6