Yaakov fled from Esav and on the way he slept. He had a dream of a ladder on top of which Hashem appeared and promised him that the land upon which he was sleeping would be given to his descendents. When he woke he said that Hashem was in this place and “I did not know”. (28,16) Rashi comments: SHE’IM YADATI LO YASHANTI BEMAKOM KADOSH KAZEH, “Had I known I would not have slept in such a holy place”. Had he not slept he would not have had the dream and he would not have heard the promise of the land. What was so wrong with his having slept? Why was he so perturbed that he had slept?
Harav Kook, the first chief Rabbi of Israel explained. Yaakov did not want to receive the land as a gift coming from Hashem in a dream. He wanted to have earned it and worked for it. Had he known, he would have stayed awake and would have striven to earn the promise as a reward for his efforts.
We often look for gifts and handouts from others. The proper way to achieve is through our efforts. If we strive, we earn and we deserve.