Daniel informed his three friends of the situation so they could pray together about it (cf. Philippians 4:6-7). [source][source][source]
"It is the first instance of united prayer recorded in Scripture; and the fact that these children of the captivity resorted to it, discovers to us the secret of their holy and separate walk." [1][source]
Since the decree affected them all, they joined in interceding corporately to "the God of heavens" (lit.). This title for God appears five times in this chapter ( Daniel 2:18-19; Daniel 2:28; Daniel 2:37; Daniel 2:44) plus elsewhere, particularly in books that have pagan Babylon as their setting. It appears in Daniel 5:23; nine times in Ezra; four times in Nehemiah; and in Genesis 24:3; Genesis 24:7; Psalm 136:26; and Jonah 1:9. The Babylonians worshipped the heavens, but Yahweh is the God over all "the heavens," not just the God of heaven. He is sovereign over all. [source][source][source]
The four young men prayed for compassion (mercy) from God, since the king"s edict was very harsh ( Daniel 2:15). They asked that God"s compassion (mercy) would manifest itself by a revelation of the king"s dream, and its interpretation ( Daniel 2:16), so they would not die with the other wise men who were worthy of death ( Daniel 2:18; cf. Genesis 18:22-33). The "mystery" in view was something unknown that they prayed God would reveal. In Scripture this is the consistent meaning of a mystery. It is not something spooky but something previously hidden by God but now revealed by Him. [source][source][source]