For he clung to the Lord; he did not depart from following Him, but kept His commandments, which the Lord had commanded Moses. (2 Kings 18:6, NASB 1995)
This was King Hezekiah’s life plan.
Later, fear deceived him into faltering but God mercifully saved Hezekiah from his own foolishness though learning the lesson was not pleasant for him.
No one is perfect. God knows this and, I believe, He helps those who desire and strive to honor Him even when they stumble.