Human nature, the law of sin within us, is always seeking to pull us again into the defilement of sin, seeking to destroy our hope of sharing life with the holy God. That is why God counsels us in Proverbs 4:23 to keep—that is, guard, preserve, and maintain—our heart. It is very easy to become defiled by lapsing back to old habits. In stark reality, Romans 8:7 and Jeremiah 17:9 show why: "Because the carnal mind is enmity against God; for it is not subject to the law of God, nor indeed can be." "The heart is deceitful above all things, and desperately wicked; who can know it?" The normal human mind deceitfully convinces each person that they are good and love God, men, and law. But the reality is just the opposite: It is at war with God and men, and hates God's holy, righteous, and spiritual law. It loves itself and its desires far more than anything else. It is this deceitful, self-centered enmity that exerts constant influence, pulling us into the defilement of sin.
John W. Ritenbaugh
The Beatitudes, Part 6: The Pure in Heart
The sense of "keep your heart" is that we need to exert more vigilance in guarding our minds than men do over anything else. Governments go to great pains to guard their installations, plans, and secrets, but God says that it is even more important to guard what we allow to reside in our minds.
Why is this is so important? Because our hearts, our minds, guide and direct everything we do, and if we do not guard and protect them from the ungodly ideas, beliefs, and entertainments, they can cause our spiritual downfall. It is in our minds and hearts that our characters are shaped, and if we allow perverse and unrighteous character to enter, the righteous character that God wants to see in us will never form.
The other instructions that Solomon gives spring from this. He tells us to ponder and control what comes out of our mouth and what we allow our eyes to view. He teaches us to make sure our feet stay on the right path, as well as to work on establishing our habits and manner of living, meaning we should not become involved in insensitive, hasty, careless, and destructive actions. The prophet Haggai puts all this very concisely, "Consider your ways!" (Haggai 1:5, 7).
John O. Reid (1930-2016)