This is Leviticus 20:10:
Jesus seems to abolish the rule in John 8:4-7:
This "contradiction" is pretty weak: it's a rather well-known piece of Christian theology that Jesus overturned and abolished many old laws. Christians do not keep kosher, for example, because of passages like Matthew 15:10-11.
It's now recognised that the text from John 7:53 to 8:11 is a later forgery and was not written by the original author. The ESV's notes contain the ominous statement "the earliest manuscripts do not include 7:53-8:11". Most other modern Bibles have similar notes and put brackets around the passage, though few seem brave enough to remove it completely.
The fact that the passage is a forgery dissolves the problem entirely - though the general point remains, that Jesus did indeed seem to bring in "a new covenant". I should note though that there is definitely a tension between this idea and passages like Matthew 5:17-19. I might examine this in a future page.