Act 4:23-31 NASB - "23 When they had been released, they went to their own companions and reported all that the chief priests and the elders had said to them. 24 And when they heard this, they lifted their voices to God with one accord and said,
"O Lord, it is You who MADE THE HEAVEN AND THE EARTH AND THE SEA, AND ALL THAT IS IN THEM, 25 who by the Holy Spirit, through the mouth of our father David Your servant, said, 'WHY DID THE GENTILES RAGE, AND THE PEOPLES DEVISE FUTILE THINGS? 26 'THE KINGS OF THE EARTH TOOK THEIR STAND, AND THE RULERS WERE GATHERED TOGETHER AGAINST THE LORD AND AGAINST HIS CHRIST.'
27 "For truly in this city there were gathered together against Your holy servant Jesus, whom You anointed, both Herod and Pontius Pilate, along with the Gentiles and the peoples of Israel, 28 to do whatever Your hand and Your purpose predestined to occur. 29
"And now, Lord, take note of their threats, and grant that Your bond-servants may speak Your word with all confidence, 30 while You extend Your hand to heal, and signs and wonders take place through the name of Your holy servant Jesus."
31 And when they had prayed, the place where they had gathered together was shaken, and they were all filled with the Holy Spirit and began to speak the word of God with boldness."
The Apostles leave from the threats of the religious authorities and have a prayer meeting. They focus their prayers with the Psalms the official book of prayer for Israel. First they focus on Psalm 146:
Psalm 146:3-6 NASB - "3 Do not trust in princes, In mortal man, in whom there is no salvation. 4 His spirit departs, he returns to the earth; In that very day his thoughts perish. 5 How blessed is he whose help is the God of Jacob, Whose hope is in the LORD his God, 6 Who made heaven and earth, The sea and all that is in them; Who keeps faith forever;"
The key to the use of the Psalm is that God is telling us not to put our ultimate trust in human rulers. They have just told the leaders of the Jews that they must obey God and not them. All human rulers will perish but the true ultimate ruler is the maker of heaven and earth. They then connect this to Psalm 2:
2:1-12 NASB - "1 Why are the nations in an uproar And the peoples devising a vain thing? 2 The kings of the earth take their stand And the rulers take counsel together Against the LORD and against His Anointed, saying,
3 "Let us tear their fetters apart And cast away their cords from us!"
4 He who sits in the heavens laughs, The Lord scoffs at them.
5 Then He will speak to them in His anger And terrify them in His fury, saying,
6 "But as for Me, I have installed My King Upon Zion, My holy mountain." 7 "I will surely tell of the decree of the LORD: He said to Me, 'You are My Son, Today I have begotten You. 8 'Ask of Me, and I will surely give the nations as Your inheritance, And the very ends of the earth as Your possession.
9 'You shall break them with a rod of iron, You shall shatter them like earthenware.'"
10 Now therefore, O kings, show discernment; Take warning, O judges of the earth. 11 Worship the LORD with reverence And rejoice with trembling. 12 Do homage to the Son, that He not become angry, and you perish in the way, For His wrath may soon be kindled. How blessed are all who take refuge in Him!"
This Psalm is taken by the Apostles to refer to Jesus as the ultimate heir of the throne of David and the anointed of the Lord. The call is on the rulers of human beings to recognize that their rebellion is in vain. They also find the rebellion because it is predicted and therefore expected. Therefore, all that has happened including the suffering of the Lord Jesus has been part of the predestined plan of God.
They are confessing their trust in God over human rulers and that they are all part of God’s grand conspiracy to bring salvation.
There prayer is that even as they face the threats and persecutions of the human rulers of the Jews let them have the boldness to proclaim the gospel and have it confirmed with signs of power. God answers this prayer by filling them with the Holy Spirit. The filling of the Holy Spirit now provides them the courage to speak regardless of what they are threatened.
The focus of the Apostles not on God ending the persecution but on the power to give a faithful witness is significant. Our focus most likely would be to ask God to end the persecution HE predicted, but instead their focus is on the ability to do complete the great commission given by the Lord Jesus to be witnesses to all nations.
How Should We Then Live
We need to expect persecution since it is part of God’s plan at the present time to come from the religious and political rulers of the popular culture of our society. The unexpected experience would be to lack such persecution. So we should have God watch over their threats but not be surprised from them.
To accomplish our roles of being witnesses we will need to be filled by the Holy Spirit with the boldness to speak with power to people about the suffering of Messiah Jesus for our sins and HIS resurrection from the dead. This filling of the Holy Spirit is vital for us to accomplish HIS evangelistic purpose. We must ask for this if we are to have ability to witness effectively. 
So don’t fear human authorities but be filled with the Holy Spirit.
Lord, help me see your sovereign rule over all human rulers and trust that you will use even their rebellion eventually for good. Help me call all people, including the rulers to confession and repentance to accept you as their Messiah. Help me have the boldness and love to speak to others and look for divine appointments to share my faith with others. Amen
This is a good outline of how to practically pray for the filling of the Holy Spirit.