In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Allaah [The Most High] said:
أَفَمَنْ أَسَّسَ بُنْيَانَهُ عَلَىٰ تَقْوَىٰ مِنَ اللَّهِ وَرِضْوَانٍ خَيْرٌ أَمْ مَنْ أَسَّسَ بُنْيَانَهُ عَلَىٰ شَفَا جُرُفٍ هَارٍ فَانْهَارَ بِهِ فِي نَارِ جَهَنَّمَ ۗ وَاللَّهُ لَا يَهْدِي الْقَوْمَ الظَّالِمِينَ
Is it then he, who laid the foundation of his building on piety to Allah and His Good Pleasure, better, or he who laid the foundation of his building on an undetermined brink of a precipice ready to crumble down, so that it crumbled to pieces with him into the Fire of Hell. And Allah guides not the people who are the Zaalimoon [polytheists and wrong doers]. [Soorah At-Tawbah: Ayah: 109]
Whoever wants his building to be elevated, then it is incumbent upon him to strengthen and fortify its foundation, because the elevation of the building is based on the firmness and fortification of its foundation. Deeds are a building and Eemaan is their foundation. If the foundation is strong, it carries and elevates the building, and if a part of the building is damaged, it is easy for it to bear the [damage]; but if the foundation is not firm, then neither will the building be elevated nor will it be firm. And if something from the foundation is damaged, the building will either collapse or close to that. Therefore, the duty of a knowledgeable person is that he makes the foundation sound and fortified. As for the ignorant person, he elevates [the building] whilst building upon other than a [strong] foundation, so his building does not remain.
The foundation of deeds is like the physical strength of a person- if the strength is vigorous, the body will be able to withstand burden and repel many harmful things; but if it is weak, the body’s ability to withstand burden is weakened and harm quickly overcomes the person. Therefore, support your building [i.e. your actions and deeds] with the foundation of Eemaan; for if something from the top of your building decays and falls down, then it would be much easier for the [building] to bear [the damage], rather than the destruction of the foundation. This foundation [i.e. Eemaan] is based on two affairs:
Firstly: Sound knowledge and awareness of Allaah, His Commandments, Names and Attributes. Secondly: Complete submission to Allaah alone [i.e. by worshipping Him alone] and [unconditional obedience to] His Messenger alone. This is the firmest foundation upon which the slave establishes his building [i.e. his actions and deeds]. Therefore, one solidifies the foundation, preserves its strength and carries on being enthusiastic, and thus what is desired [i.e. success in this life and the next] will be reached [InShaaAllaah].
[Source: An Excerpt from ‘Al-Fawaa-id: page 154. slightly paraphrased]