At the center of anything in life is a core. For the human being, that core is the heart. Allah ﷻ has created us in such a way that our actions are dependent on the state of our hearts. If there is any impurity within the heart, that impurity will manifest itself in one’s actions through inconsistency in worship and dhikr, and the inability to leave sin. When the heart becomes pure, however, it will lead a person to consistency in obeying the commands of Allah ﷻ and His Messenger ﷺ and leaving their prohibitions — the person will develop regularity in salah, reciting the Qur’an and visiting the masjid; their interactions with their parents, family and community members will improve; even the smallest actions done with a pure heart will become acts of worship.
There are two mechanisms by which the heart can be purified. The first is through performing istighfar, or regularly seeking forgiveness for one’s mistakes — this serves as a detergent for the heart and wipes it clean, and should be done every morning and every evening for the sins we committed throughout the day. The second mechanism is spending time in the company of the people of taqwa, or piety; the light of Allah ﷻ that descends upon hearts that remember Him also affects the hearts of those around them, creating a powerful and transformative effect from their company, even in just a few moments. A person should consistently make istighfar and regularly spend time in the company of the pious, with the intention of purifying their heart so that they may attain nearness to Allah ﷻ.