God did not give His law with the goal of giving death to His people, but rather He is a loving Father who knows how to give gifts to His children that our for own good in order to bless us (Deuteronomy 6:24, 10:12-13), so you have not correctly identified the trees. Before Adam and Eve had eaten from either Tree, they were at a crossroads between morality and eternal life, where eating from the Tree of Knowledge caused them to become mortal while eating from the Tree of Life would have caused them to have eternal life. In Deuteronomy 30:15-20, the Israelites were at an identical crossroads where Moses presented a choice between life and death, life and a blessing for obedience to God's law and death and a curse for disobedience.
There are a number of ways that show that Eve's desire warped her perception (Genesis 3:6) and when our desire enters the picture, then it clouds out judgement so that we can no longer be in ourselves whether something is true good or if we just think that it is good because we desire it, and it is trusting in our clouded judgement of good and evil that leads to death. This is where Proverbs 3:5-7 comes into play, where we have the same choice of whether we are going to lean in our own understanding of right and wrong by doing what is right in our own eyes or whether we are going to trust in God with all of our heart to correctly divide between right and wrong through what He has instructed, and He will make our paths straight, and this is what it means to have faith. In Proverbs 3:18, she is a Tree of Life for all who take hold of her and those who hold her fast are called blessed. In other words, the point of everything in the Bible is to teach us how to undo the damage done by eating from the the Tree of Knowledge and to instead choose to eat from the Tree of Life.
In Deuteronomy 32:46-47, God's law is our very life. In Proverbs 6:23, for the commandment is a lamp and the teaching a light, and the reproofs of discipline are the way of life. In Matthew 19:17, Jesus said that the way to enter eternal life is by obeying God's commandments. In Luke 10:25-28, Jesus said that the way to inherit eternal life is by obeying the greatest two commandments. In Hebrews 5:9, Jesus has become a source of eternal salvation for those who obey him. In Revelation 22:14, those who kept God's commandments are given the right to eat from the Tree of Life. In Romans 2:6-7, those who persist in doing good will be given eternal life. In Romans 6:19-23, no longer presenting ourselves as slaves to impurity, lawlessness, and sin is contrasted with now presenting ourselves as slaves to God and to righteousness leading to sanctification, and the goal of sanctification is eternal life in Christ, which is the gift of God, so obedience to God's law is the content of His gift of eternal life.
In Psalms 119:29-30, he wanted to put false ways far from him, for God to be gracious to him by teaching him to obey His law, and he chose the way of faithfulness by setting God's law before him, so this has always been the one and only way of salvation by grace through faith. In Exodus 33:13, Moses wanted God to be gracious to him by teaching him to walk in His way and that might know Him and Israel too, and in Matthew 7:23, Jesus said that he would tell those who are workers of lawlessness to depart from him because he never knew them, so knowing God and Jesus is the goal of the law, which again is eternal life (John 17:3). In Genesis 6:8-9, Noah found grace in the eyes of God, he was a righteous man, and he walked with God, so God was gracious to him by teaching him to walk in His way in obedience to His law and he was righteous because he obeyed through faith. In Romans 1:5, we have received grace in order to bring about the obedience of faith. In Titus 2:11-14, our salvation is described as being trained by grace to do what is godly, righteous, and good, and to renounce doing what is ungodly, so God graciously teaching us to do these works in obedience to His law is the content of His gift of salvation. So God is gracious to us by teaching us to obey His law, but you want God to be gracious to you instead of obeying His law.
In Acts 2:38, it calls for us to repent from our sins and in Romans 3:20, God's law is how we know what sin is, so getting out from under God's law is the opposite of obeying Acts 2:38.