וַיְהִי מִקֵּץ שְׁנָתַיִם יָמִים וּפַרְעֹה חֹלֵם
It came to pass at the end of two full years, that Pharaoh was dreaming
We sometimes, if not often, go through various troubles and seek ways out of them. What we too often ignore is that the result is already determined.
Yosef HaTzaddik was imprisoned, and Hashem already had planned the dreams of Pharaoh that would lead to his release. (See here for more on that.) Yosef asked Pharaoh’s drinkmaster who had been imprisoned with him to please advocate for his release. This was ok, we are supposed to seek natural ways out of issues that arise. However, Yosef asked twice to be remembered, on his level this reflected a slight lack of Emunah. He only needed to ask once for it to happen. The repetition made it seem like he actually thought he was accomplishing something by asking, as opposed to the understanding that Hashem was doing it and he was just the vehicle to set the ball in motion.
Yosef was punished for this with the delay of the already on-their-way dreams by two years. When we realize that Hashem is doing everything, it not only leads to peace of mind, but can actually lead to a quicker resolution.