And now shall mine head be lifted up above mine enemies round about me: therefore will I offer in the tabernacle sacrifices of joy; I will sing, yea, I will sing praises unto the Lord.
David knew that in a time of trouble the Lord would hide him in His presence and set him on a rock. The rock is Christ, who will be with us always to hide and keep us from our enemies. Therefore, the response is to offer sacrifices of joy and to sing praises unto the Lord. He knew where to go and what to do when the enemies lurk around and threaten.
We, too, respond to a time of trouble by hiding in His Presence, which is always near us and in us, to sacrifice and praise. We know where to go, to Him who loved and gave Himself for us. The sacrifices we offer are the good works we do giving up our time, talent, and treasure for the service of others. And it is a joyful thing to do, as it is for God our Savior.
In the Presence of God, where we are safe, we sing praises unto the Lord. We praise Him for He is good and His mercy endures forever and for His salvation and protection. It is a response of faith. And praise consciously reminds us of the love and care of God, that we are safe in His Presence. Singing praises does not bring us into the temple, but it reminds us that we already there by faith.
The good news for the NT believer is that any time (in a time of trouble or not) and anywhere (in church or at home) we may respond by dying to self with joy by giving and serving others, and we may sing and make melody in our heart to the Lord. Then my head will be lifted up above my enemies, above the troublous circumstances of life in this world. This God does for us.