Samson pleads for the Lord to strengthen him one last time so that he can end his captivity in the only way possible and take his enemy tormentors with him. This has the appearance of him asking for God's help in committing suicide. And the fact that God answered his plea, helping him to bring down the building on the enemy of Israel and thereby to end his own life, suggests to some that God approved of his desire to end his own life in this way.
But was Samson's death a suicide? In one sense, it could be seen that way. And thus it could be said that God helped him in this. Yet for Samson he was not merely trying to put himself out of misery, as King Saul would later do (1 Samuel 31:4). Rather, this was an act of self-sacrifice, even though Samson's stated desire for strength was revenge. He volunteered his life to take down the enemy, something akin to a soldier volunteering his life on the battlefield. The Lord gave a positive response to Samson's prayer, vengeful though it was, since God's purpose all along has been to help Israel. He would use this final outcome to fulfill his intention of beginning to deliver Israel from the Philistines through Samson (Judges 13:5).
30 And Samson said, “Let me die with the Philistines.” Then he bowed with all his strength, and the house fell upon the lords and upon all the people who were in it. So the dead whom he killed at his death were more than those whom he had killed during his life.