The author of Hebrews carefully follows the order of thought in the psalm.
In the passage above He says, "Sacrifices and offerings, burnt offerings and sin offerings You did not desire…": The author of Hebrews sees this as God rejecting the old system of sacrifices.
Then He adds, “Here I am, I have come to do Your will.”: The author of Hebrews interprets this as Christ's willingness to be the ultimate sacrifice for sins.
The author of Hebrews concludes that because of Christ’s sacrifice, God has canceled the first covenant. God’s plan, as shown by Psalm 40:6–8, was for Christ to die for sins as a sacrifice, and this only needed to happen once for all time.