What is the meaning of Acts 23:10-11?

10 And when there arose a great dissension, the chief captain, fearing lest Paul should have been pulled in pieces of them, commanded the soldiers to go down, and to take him by force from among them, and to bring him into the castle. 11 And the night following the Lord stood by him, and said, Be of good cheer, Paul: for as thou hast testified of me in Jerusalem, so must thou bear witness also at Rome. (Acts 23:10-11 KJV)

William Burkitt’s Commentary

St. Paul was now in the midst of difficulty and danger; but observe how timely God steps in for his succour and deliverance: First, he stirs up that heathen tribune, the chief captain Lysias, who was present at the trial, to see his prisoner have fair play; the Lord stirs up this man to rescue the apostle from the hands of violence, by which he was in danger of being pulled in pieces, and he is returned safely into the castle again.

Oh, how God’s encouragements evermore accompany his commands! His faithful servants, when they suffer for him, shall certainly be delivered by him, either in trouble or out of trouble.

Secondly, God comforts the suffering apostle with his own presence, and with the gracious manifestations of his special favour;  The Lord stood by him, and said, Be of good cheer, Paul.–

Where note, That if the Lord stand by, and be graciously present with his servants, in a suffering hour, it is no matter how many and how mighty they be that do withstand them, and appear against them. No doubt these words,  Be of good cheer, Paul, turned the apostle’s prison into a palace and enabled him to bid bold defiance to all the devilish designs of the Jews in Jerusalem against him; having got such good security for his safety, even from God himself, in the faith of which our apostle holily triumphs, saying,  If God be for us, who can be against us:  Ro 8:31. That is, none can be against us, either safely or successfully. The presence of God with his suffering servants outweighs all their discouragements.