The decisive factor is for what purpose a person gives his life. No one lives for himself, and no one dies for himself; for if we live, it is for the Lord, and if we die, it is for the Lord (Romans 14:7-9). Thus, if we give our life and sacrifice it, such an act must be answerable before God.
With these givens, it will not be difficult for us to positively evaluate Samson’s act of suicide. He was not concerned with his own death, with which he could put an end to his miserable situation; but his last act was an extension of his life’s task, namely to do harm to the Philistines as the enemies of God’s people. This is what the Bible calls attention to: the dead that Samson killed in his death were more numerous than those he had killed in his life (Judges 16:30).
I would like to mention also another example which deserves our full recognition, namely that of the army chaplain Allard Pieron. Together with other prisoners of war he was to be taken to Japan by ship. However, on their way the vessel was torpedoed. In the lifeboat in which Pieron found himself there was one person too many. He sacrificed himself, jumped overboard and disappeared in the waves. This minister thus gave his life for his friends!
Jochem Douma
See the article: What Does the Bible Say About Suicide?
29 And Samson grasped the two middle pillars on which the house rested, and he leaned his weight against them, his right hand on the one and his left hand on the other.