As long as Adam and Eve were obedient and did not eat of the tree of the knowledge of good and evil, they had access to the tree of life.
Once they sinned, they were driven from the Garden, and God placed an angel with a flaming sword to guard the tree of life so they would no longer have access to it.
Eternal life was now no longer theirs.
Just as God had warned, they died, and through Adam all men after him would die (Romans 5:12).
By blocking access to the tree of life, God showed compassion in His omniscience. Knowing that because of sin, life would be filled with sorrow and toil, He graciously limited the number of years men would live.
To live eternally in a sinful state with its results—pain, disease, heartache, toil, and grief—would mean endless agony for humanity, with no hope of the relief that comes with death.
By limiting our lifespan, God gives us enough time to come to know Him and His provision for eternal life through Christ, but spares us the misery of an endless existence in a sinful condition.
Through one man, Adam, sin entered the world, but through another Man, Jesus Christ, redemption through the forgiveness of sin is available to all (Romans 5:17).
Everyone who avails themselves of the sacrifice of Christ on the cross will see the tree of life again, for it stands in the middle of the Holy City, the New Jerusalem.
Its water is the constant flow of everlasting life from God’s throne to God’s people...
I also saw the Holy City, new Jerusalem, coming down out of heaven from God, prepared like a bride adorned for her husband.
Revelation 21:2
Then he showed me the river of living water, sparkling like crystal, flowing from the throne of God and of the Lamb down the middle of the broad street [of the city]. On both sides of the river was the tree of life bearing 12 kinds of fruit, producing its fruit every month. The leaves of the tree are for healing the nations
Revelation 22:1-2