In Ephesians 2:8-10, we are new creations in Christ to do good works, so while Paul denied that that we can earn our salvation as the result of our works lest anyone should boast, doing good works is nevertheless intrinsically part of our salvation from not doing good works.
The content of a gift can itself be the experience of doing something, again, such as giving someone the opportunity to experience driving a Ferrari for an hour, where the gift requires someone to do the work of driving it in order to have that experience, but where doing that work has nothing to do with trying to earn the gift the opportunity to drive it as a wage. Likewise, the content of God's gift of eternal life is the experience of knowing Him and Jesus (John 17:3) and the gift of God's law is His instructions for how to have that experience, not for how to earn eternal life as a wage (Exodus 33:13, Matthew 7:23).
There are many verses that support that the way to have eternal life is by obeying God's commandments, such as Deuteronomy 30:11-16, Deuteronomy 32:46-47, Proverbs 3:18, Proverbs 6:23, Matthew 19:17, Luke 10:25-28, Romans 2:6-7, Romans 6:19-23, and Revelation 22:14, and there are many verses like John 3:16 and 5:24 that say that the way to have internal life is by believing in Jesus, which means that God's commandments are His instructions for how to believe in Jesus, which is also why there are many other verses that connect our belief in God with our obedience to him.
What about them?
Indeed, there has been much discussion on this topic, so I would not have started a thread on it if I did not think that I was raising an important distinction that resolves this issue.