Failure is there to be overcome.

LINK
God wants us to have victory in everything, He wants us to overcome all the tests and to learn from that, for that He has given us through Jesus Christ absolutely all the resources we need to be victorious.
15 For what I do, I do not understand; for what I want, I do not do, but what I hate, that I do. 16 And if I do what I do not want, I approve the law that it is good. 17 So then it is no longer I who do it, but sin that dwells in me. 18 And I know that in me, that is, in my flesh, nothing good dwells; for to will is present with me, but how to perform it I do not. 19 For the good that I want, I do not do, but the evil that I do not want, that I do. 20 And if I do what I do not want, it is no longer I who do it, but sin that dwells in me.
Romans 7:15-20
God's desire is the victory of his children, this is God's will. But there are times when we repeatedly relapse into the same error, into the same sin, what is the reason why we fail to do the right thing?
One reason why we relapse into the same sin is because we fail to truly repent, perhaps we are experiencing shame or much sorrow for that sin we have committed, sin does not consist only of words from the mouth outward, of crying a little and that's it, repenting means that with all our heart we must not return to the same thing and thus begin a change of mentality about sin, stop clinging to our perspective and look at things from God's perspective, that our heart and mind turn to the direction of God and stop persisting in sin.
He who covers his sins will not prosper;
But he who confesses and forsakes them will have mercy.
Proverbs 28:13