It seems he is in very difficult situation.
It seems Joseph was in very difficult situation (Gen. 40:14).
He didn’t do anything wrong but he was unfairly accused and imprisoned (39:11-23).
When we look at the situation that Joseph was in, he could have been very angry.
But he didn’t. Instead after he interpreted the cupbearer’s dream,
he asked him to mention him to Pharaoh and get him out of the imprisoned situation
when it goes well with him (40:1-22).
But the cupbearer forgot about Joseph for 2 ears (40:23-41:1).
It seems to us that Joseph was in very discouraging situation because he was in prison
Even though he didn’t to anything wrong
And he can think that 2 years have been wasted (41:1).
However, God knew the Joseph's situation best.
He knew that Joseph was badly framed and imprisoned.
And God knew that Joseph had been in prison for two years.
But God never wasted those 2 years.
God was working on toward His will of salvation.
In His provision, He was working in Joseph’s life
in order to save the lives of Joseph’s brothers and their children and descendants
(45:7-8; 50:20-21).