“I say to you, if anyone keeps My word he shall never see death.” (Jn 8.51)This correspondes to what the Holy Spirit spoke through the mouths of Joshua & David. Joshua tells the children of Israel to take careful heed to do the commandment and the law which Moses the servant of the LORD commanded you, to love the LORD your God, to walk in all His ways, to keep His commandments, to hold fast to Him, and to serve Him with all your heart and with all your soul. (Josh 22)
And David commands his son, Solomon, to walk in His [the Lord's] ways, to keep His statutes, His commandments, His judgments, and His testimonies, as it is written in the Law of Moses. Then David adds this promise:
that you may prosper in all that you do and wherever you turn; that the LORD may fulfill His word which He spoke concerning me, saying, ‘If your sons take heed to their way, to walk before Me in truth with all their heart and with all their soul,’ He said, ‘you shall not lack a man on the throne of Israel.’How are we to understand these words? How are we to understand these commands?
The Law and commandments flow from the mercy of God. For they are handed down not as a test, not to threaten, but so that we might be safe-guarded from our own self-destructive ways and so that, through them, we may safely attain the kingdom of heaven.
Now should we refuse to walk in the way of the Law and in the works of the commandments, then they accuse us of going our self-chosen way--that is, against the Lord's way. But it appears that the primary use of the Lord's Law is merciful; so that we might remain in the way which is Christ Jesus our Lord.