Then said they unto him, What shall we do, that we might work the works of God?
Note 3 at Joh 6:28: All throughout history, mankind has been seeking what they must do to do the works of God. All people have a knowledge within them of the reality of God (Ro 1:18-20) and a desire to be right with Him. However, just as with these Jews, few agree with the Lord as to how to do it. These Jews were willing to do something to obtain salvation, but they were not willing to commit themselves to Jesus and accept His gift.
This is one of the major differences between Christianity and the religions of the world. Religion is willing to make sacrifices to obtain right standing with God, but Christianity recognizes our complete inability to ever do enough to save ourselves and calls for total faith and reliance on what Jesus did for us.
As Jesus began to explain to them in these verses how He was the only way to the Father (Joh 14:6) and that they would have to come through Him, the people grew angry. It always angers the flesh to think that all our righteous acts can't save us, but Jesus made it clear that our only part in salvation is to believe. Believe what? Believe on Jesus and His sacrifice, not ours. Salvation is a gift and cannot be purchased (Ro 10:2-3).