Then Daniel went to his home and informed his companions, Hananiah, Mishael, and Azariah, and told them to seek mercy from the God of heaven concerning this mystery, so that Daniel and his companions with the rest of the wise men of Babylon might not perish. Then the mystery was revealed to Daniel in a vision of the night, and Daniel blessed the God of heaven. Daniel said: “Blessed be the name of God from age to age, for wisdom and power are his. He changes times and seasons, deposes kings and sets up kings; he gives wisdom to the wise and knowledge to those who have understanding. He reveals deep and hidden things; he knows what is in the darkness, and light dwells with him. To you, O God of my ancestors, I give thanks and praise, for you have given me wisdom and power, and have now revealed to me what we asked of you, for you have revealed to us what the king ordered.” (Daniel 2:17-23, NRSV)
Daniel went and prayed to God along with his friends, and God listened to their prayers and revealed to Daniel the dream of King Nebuchadnezzar and the interpretation of it
God is to be praised for His steadfast love and care for us. Daniel was set to be killed, but God gave him the answers he needed to appease the king.
God will always provide us with what we need!