“The steps of a good man are ordered by the Lord, and He delights in his way. Though he fall, he shall not be utterly cast down; for the Lord upholds him with His hand.” vs23-24
This happened to me. I fell down, but the Lord lifted me up. There's hope for the righteous.
One, the righteous fall. “Though he fall.” We are sinners in the flesh who become entangled, as Paul did [Acts 23:6]. Yet, we do not fall away. We fall into sin - fornication, pornagraphy, and drunkenness - but it doesn't swallow us whole. We fall into unbelief and false doctrine, even bitterness and envy, but the Lord doesn't let us go.
He's gracious to His erring saints, keeping His covenant. He won't allow sin to be punished twice, nor to have dominion. We have a holy nature, so we struggle and find no rest.
Secondly, God convicts the conscience to bring us out. “He shall not be utterly cast down.” He shows us sin and pain, withering us until we repent. Then, He restores the years the locusts have eaten, and returns His joy in due time [Joel 2:25]. He receives us like the Prodigal with kisses. He puts His fear in our heart.
“I will surely gather My people from all the lands to which I have banished them in My furious anger and great wrath, and I will return them to this place and make them dwell in safety. They will be My people, and I will be their God. I will give them one heart and one way, so that they will always fear Me for their own good and for the good of their children after them.” -- Jer 32:37-39
God's gracious because He sees us in Christ, the Sin bearer! He keeps His covenant, because He remembers His love. He saw all of our wonderings when He predestined us to Paradise. He sees the thief, all of his life rebelling, and He sees him crying out in his last hours [Luke 23:42]. The sins of the saints do not change Him, nor do the sins of the sinner.
Finally, look to the Lord Jesus Christ. Remember Him - that He's good and upright, so He teaches sinners, loves saints, and recovers the fallen.