As Muslims, we are to completely trust Allah (have "Tawakkul") for all our affairs. We also believe that Allah's will can supersede our plans. However, this does not mean that we should not plan and work based on what Allah has blessed us in knowledge, intelligence, and free will. Common sense, as well as Islamic teachings, tells us that we are to fully employ those God-granted faculties thanking Allah of what he has provided us, without feeling proud and arrogant about those abilities. We see an example of this from the Quran where it tells us that when Prophet Yaqub sent his sons to Egypt, he advised them as a precautionary measure to enter from different gates of the city lest they be mistaken as a clan or a group raising suspicions amongst the inhabitants of the city. So, we see that even as a prophet, Prophet Yaqub took all the precautionary measures that he could to prevent his sons from getting into any trouble. However, later we also learn from Surah Yousuf in the Quran that his precautionary measures were overtaken by the divine decree of Allah.
Most people do not understand how Prophet Jacob (Yaqub) was able to hold the balance between "trust in Allah" and the adoption of precautionary measures. It was because Allah had favored him with real knowledge. That is why he took all those measures which were dictated by common sense, deep thinking and experience.
He admonished his sons for their ill treatment towards their brother (Prophet) Yousuf so that they would not dare repeat it in the case of Benjamin.
He took a solemn pledge from them in the name of AIlah that they would take good care of the safety of their step-brother.
Then he advised them to be on their guard against the dangerous political situation and to enter the capital by different gates so as not to give cause for alarm and suspicion.
In short, as far as it was humanly possible, he took all the precautionary measures to avoid every possible risk.
On the other hand, he always kept in view and expressed his faith that no human precautionary measure could avert the enforcement of Allah's will, and that the real protection was Allah's protection, and that one should rely not on the precautionary measures but on the favor of Allah. Obviously only that person who has the real knowledge can keep such a balance in his words and deeds, who knows what kind of efforts are demanded of his human faculties bestowed by Allah for the solution of worldly problems, and who also realizes that it is Allah alone who has the power to make them a success or a failure.
This is what most people do not understand. Some of them rely merely on their efforts and measures and discard trust in Allah while there are others who rely merely on 'trust in AIlah' and do not adopt any practical measure to solve their problems.
The lesson that we learn from the above is that we, as Muslims, should have complete faith in Allah to help us in our endeavors because without His will and help no results can come to fruition. When we completely put our trust in Allah believing that all success can come only when He intends it to be so, we can earn Allah's pleasure. Allah tells us in the Quran:
"...Certainly, Allah loves those who put their trust (in Him)."
(Surah Aal-e-Imran, Verse 159)
In parallel, we should also use all our God-granted faculties in every endeavor that we choose to pursue. As we know from the popular hadith that one day Prophet Muhammad (peace be upon him) noticed a Bedouin leaving his camel without tying it and he asked the Bedouin, "Why don't you tie down your camel?" The Bedouin answered, "I put my trust in Allah." The Prophet then said, "Tie your camel first, then put your trust in Allah" (At-Tirmidhi).
Finally, does the above guarantee that we will get our intended result? As Muslims, we should believe that Allah as the Lord of the worlds has far more knowledge than His creation, and out of His wisdom He may decide to supersede all our plans for reasons that only He knows. We should remind ourselves that believing in Al-Qadr (Allah's divine will and decree) is one of the pillars of Islamic faith.
Allah says in the Quran,
"No calamity befalls on the earth or in your selves but it is inscribed in the Book of Decrees (Al-Lawh Al-Mahfooz) before We bring it into existence. Verily, that is easy for Allah."
(Quran, Surah Al-Hadeed, Verse 22.)
So, before embarking on an effort, remind yourselves of the following:
Put your trust in Allah;
Use your God-granted faculties to put in your best efforts;
Believe in the divine decree (Qada wal-qadr).