The Lord knoweth - יודע yodea approveth the way, "aloweth the way", Coverdale, of the righteous, צדיקים tsaddikim, from צדק tsadak, to give even weight; the men who give to all their due; opposed to רשעים reshaim, Psalm 1:1, they who withhold right from all; see above. Such holy men are under the continual eye of God's providence; he knows the way that they take; approves of their motives, purposes, and works, because they are all wrought through himself. He provides for them in all exigencies, and defends them both in body and soul.
The way of the ungodly shall perish - Their projects, designs and operations, shall perish; God's curse shall be on all that they have, do, and are. And in the day of judgment they shall be condemned to everlasting fire in the perdition of ungodly men. The wicked shall perish at the presence of the Lord. Reader take warning!
For the Lord knoweth the way of the righteous - This is given as a reason why the wicked would not stand in the judgment with the righteous. The reason is, that the Lord, the great Judge, fully understands the character of those who are his friends, and can discriminate between them and all others, whatever pretences others may make to that character. Only those whom God approves, and loves, as his friends, will be able to stand in the day when the great decision shall be made. No one can impose on him by any mere pretensions to piety; no one can force his way to his favor, or to the rewards of the just, by power; no one can claim this in virtue of rank and station. No one can be admitted to the favor of God, and to the rewards of heaven, whose character is not such that it will bear the scrutiny of the Omniscient eve. Compare the notes at 2 Timothy 2:19. Man may be deceived in judging character, but God is not. When it is said that “the Lord knoweth the way of the righteous,” the word “way” seems to be used to denote the whole of life - the manner of living (Notes, Psalm 1:1), and hence, the whole character. Perhaps there is included also the idea that the Lord knows the result of their manner of life - the issue to which it leads - and that, therefore, he can properly judge the righteous and assign them to that place in the future world, to wit, heaven, to which their actions tend.
But the way of the ungodly shall perish - The way or manner in which the ungodly live shall tend to ruin; their plans, and purposes, and hopes, shall come to nought. Their course, in fact, tends to destruction. None of their plans shall prosper in regard to religion: none of their hopes shall be fulfilled. In this, as in all other respects, they stand in strong contrast with the righteous, alike in this world and the world to come.