In this week's parsha we read how Yosef is falsely accused of improper conduct and as a result is thrown into jail by his master Potiphar. After sitting in jail for ten years, Yosef is presented with an opportunity to be released from bondage. He correctly interpreted the dream of another jail mate, the Sar Hamashkim, - foretelling his imminent release. Yosef felt that this would be an opportune time to bring his case before Pharaoh, and he requested from the Sar Hamashkim to remember him favorably before the king. Rashi (Bereishis 40, 23) tells us that because Yosef placed his trust in an Egyptian, he was punished by having to spend another two years in jail.
Rav Wolbe (Shiurei Chumash) notes that the Ramban in the beginning of Parshas Vayishlach writes that tzaddikim do not rely on their righteousness, but rather attempt to save themselves with the resources available to them (as discussed in last week's dvar Torah). If so, he asks, why was Yosef punished for asking the Sar Hamashkim to help him? Wasn't this a normal act of hishtadlus?
Rav Wolbe quotes the Chazon Ish (Sefer Emunah U'Bitachon) who explains as follows. One definitely has to make a hishtadlus. However, he must calculate if his hishtadlus has a reasonable chance to succeed. As Rashi tells us, the Egyptians are described as "rahavim" - arrogant, and therefore, Yosef should not have placed his trust in an Egyptian. His request was made out of despair - like a drowning man grabbing at a piece of straw - and it was for this reason that he was at fault. On Yosef's high spiritual level, such an attempt could not be considered a reasonable hishtadlus.
The Mashgiach offers another explanation as well. There was nothing wrong with the actual request that Yosef made of the Sar Hamashkim. Yet, as Rashi emphasizes, "Yosef placed his trust in the Sar Hamashkim." One must be aware that all attempts are merely a fulfillment of his obligation to make a hishtadlus; his trust must be placed completely in Hashem. On Yosef's high spiritual level, he was punished for placing his trust to a small degree in man.
Even when one plants a seed in the ground, he should be cognizant of the fact that it is Hashem Who causes the seed to sprout. The planting is an act of hishtadlus; the actual sprouting happens because Hashem decides to fulfill the farmer's desire and causes the tree to grow. Everything that happens in this world is solely because Hashem so wishes. Therefore, despite our obligation to make a hishtadlus, it is merely a hishtadlus, and it is in Hashem that we must place our complete trust.