God uses dreams to reveal His purposes
Gen 40 to 42 There is much to be said about Joseph and Daniel. That is, how alike they are in so many ways: faithful to God, raised to prominence, and used in ungodly kingdoms for His purpose. Both are proof of this verse: Luke 12:31 ‘But seek His kingdom, and these things will be added to you.” They lived a righteous life in an unrighteous world, do we?
Both were patient in trials; were given wisdom, and gave credit for their spiritual understanding of God and His ways when ungodly men had dreams that needed interpretations. In Gen 40:8, Joseph says: “Do not interpretations belong to God?” Standing before Pharaoh, Joseph again reminds this ungodly ruler: “It is not in me; God will give Pharaoh a favorable answer.” [Ge 41:6]
Later, Joseph’s brothers came to buy grain in Egypt for the famine was very great, and they heard there was grain in Egypt. God has His ways to bring these brothers to repentance and protect Jacob’s line. Joseph remembers his dreams when they bow, but he allows them to grovel to test them and their hearts. He keeps Simeon because he was the ringleader of the Shechemites event; he is listed first in that chapter [Gen 34:5]. God has His way of disciplining his children.
Where has God given you wisdom to be used for ungodly people? Where is God disciplining you (me)?