I have refrained my feet from every evil way
Of error or immorality, forbidden and condemned by the word of God; every way that is evil in itself, or leads to evil, and in which evil men walk; and though there may be many snares and temptations to walk in such a way, yet a good man cannot allow himself to walk therein, as others do; he has not so learned the word of God; he is under the influence of divine grace, and withholds himself from it; he abstains from all appearance of evil, and lays a restraint, as upon his mouth and lips, so upon his feet, or guards his walk and conversation. This shows, that as David had an affection for the word of God, and made great proficiency in knowledge by it; so it had an influence on his life and conversation, and his knowledge appeared to be not merely speculative, but practical: his end, in laying such a restraint upon his feet, was not out of vain glory, and to gain popular applause nor through fear of losing his credit among men, nor of the wrath of God; but out of love to God, and to his word, as follows:
that I might keep thy word;
such was his love to it, and his regard to the honour of it; considering whose word it was, and with whose authority it was clothed, and whose glory was concerned therein; that he was careful to walk according to it, and in the way that directed to, and shun every other way.