Judges 16:28-30 V28 And Samson called unto the LORD, and said, O Lord GOD, remember me, I pray thee, and strengthen me, I pray thee, only this once, O God, that I may be at once avenged of the Philistines for my two eyes. V29 And Samson took hold of the two middle pillars upon which the house stood, and on which it was borne up, of the one with his right hand, and of the other with his left. V30 And Samson said, Let me die with the Philistines. And he bowed himself with all his might; and the house fell upon the lords, and upon all the people that were therein. So the dead which he slew at his death were more than they which he slew in his life.
Samson failed the Lord by telling Delilah the secret of his strength. But, in Samson's death he accomplished more in his death than he did in his entire lifetime.
Failure isn't final with God. Though we fail it isn't the end of the story for us. God can still use us. Don't be discouraged by your failure. Keep praying and looking to God for strength. The Lord gave Samson victory.