KNOW that sins are a barrier between you and Allah. Keeping away from that which makes you far from Allah is obligatory. It is achieved by 1) knowledge, 2) regret and 3) determination. If one does not truly KNOW that sins are the cause of being far from Allah, he will have no regrets over committing sins. He will not feel the pain of his path far from his Lord. When that pain is not felt, he will not return nor have the determination to stay away from sin. Allah ordered us to make tauba saying:
ÇáäæÑ
... æóÊõæÈõæÇ Åöáóì Çááøóåö ÌóãöíÚðÇ ÃóíøõåóÇ ÇáúãõÄúãöäõæäó áóÚóáøóßõãú ÊõÝúáöÍõæäó(31){... and repent to Allah all of you O believers in order that you may reach success.}
ÇáÊÍÑíã
íóÇÃóíøõåóÇ ÇáøóÐöíäó ÁóÇãóäõæÇ ÊõæÈõæÇ Åöáóì Çááøóåö ÊóæúÈóÉð äóÕõæÍðÇ ÚóÓóì ÑóÈøõßõãú Ãóäú íõßóÝøöÑó Úóäúßõãú ÓóíøöÆóÇÊößõãú æóíõÏúÎöáóßõãú ÌóäøóÇÊò ÊóÌúÑöí ãöäú ÊóÍúÊöåóÇ ÇáúÃóäúåóÇÑõ íóæúãó áóÇ íõÎúÒöí Çááøóåõ ÇáäøóÈöíøó æóÇáøóÐöíäó ÁóÇãóäõæÇ ãóÚóåõ äõæÑõåõãú íóÓúÚóì Èóíúäó ÃóíúÏöíåöãú æóÈöÃóíúãóÇäöåöãú íóÞõæáõæäó ÑóÈøóäóÇ ÃóÊúãöãú áóäóÇ äõæÑóäóÇ æóÇÛúÝöÑú áóäóÇ Åöäøóßó Úóáóì ßõáøö ÔóíúÁò ÞóÏöíÑñ(8){O you who believe, repent to Allah a completely sincere repentance that perhaps He may nullify for you your bad deeds and put you in gardens under which rivers flow on a day on which Allah will not shame the Prophet nor those who believed along with him. Their light strives before them and on their right. They say, "Our Lord, complete for us our light and forgive us. You are surely in power over all things.}
ÇáÈÞÑÉ
... Åöäøó Çááøóåó íõÍöÈøõ ÇáÊøóæøóÇÈöíäó æóíõÍöÈøõ ÇáúãõÊóØóåøöÑöíäó(222){Verily, Allah loves those who ever turn to Him in repentance and He loves those who cleanse themselves.}
öAbout tauba, the Prophet (sas) said:
ãÓáã
ÃóíøõåóÇ ÇáäøóÇÓõ ÊõæÈõæÇ Åöáóì Çááøóåö ÝóÅöäøöí ÃóÊõæÈõ Ýöí Çáúíóæúãö Åöáóíúåö ãöÇÆóÉó ãóÑøóÉò"O people, repent to Allah for I repent to Allah one hundred times a day.
ãÓáã
áóáøóåõ ÃóÔóÏøõ ÝóÑóÍðÇ ÈöÊóæúÈóÉö ÚóÈúÏöåö ÇáúãõÄúãöäö ãöäú ÑóÌõáò Ýöí ÃóÑúÖò ÏóæøöíøóÉò ãóåúáößóÉò ãóÚóåõ ÑóÇÍöáóÊõåõ ÚóáóíúåóÇ ØóÚóÇãõåõ æóÔóÑóÇÈõåõ ÝóäóÇãó ÝóÇÓúÊóíúÞóÙó æóÞóÏú ÐóåóÈóÊú ÝóØóáóÈóåóÇ ÍóÊøóì ÃóÏúÑóßóåõ ÇáúÚóØóÔõ Ëõãøó ÞóÇáó ÃóÑúÌöÚõ Åöáóì ãóßóÇäöíó ÇáøóÐöí ßõäúÊõ Ýöíåö ÝóÃóäóÇãõ ÍóÊøóì ÃóãõæÊó ÝóæóÖóÚó ÑóÃúÓóåõ Úóáóì ÓóÇÚöÏöåö áöíóãõæÊó ÝóÇÓúÊóíúÞóÙó æóÚöäúÏóåõ ÑóÇÍöáóÊõåõ æóÚóáóíúåóÇ ÒóÇÏõåõ æóØóÚóÇãõåõ æóÔóÑóÇÈõåõ ÝóÇááøóåõ ÃóÔóÏøõ ÝóÑóÍðÇ ÈöÊóæúÈóÉö ÇáúÚóÈúÏö ÇáúãõÄúãöäö ãöäú åóÐóÇ ÈöÑóÇÍöáóÊöåö æóÒóÇÏöåö æ"Allah is more joyous with the repentance of His believing slave than a man in a vast plain who had with him his mount, his food and his drink. He slept and awoke but his mount was gone with all of his supplies. He searched and searched until thirst overcame him. He said, "I will return to my original spot and lie down to die." So, he put his head on his arm to await death. Then he awoke to find his mount before him with all of his supplies intact. Allah is more joyous with the repentance of his believing slave than this man is with his mount and his supplies."
There are many other hadith on this subject. There is complete ijmaa' on the obligatoriness of repentance (tauba) because sins are destroyers which distance one from Allah Most High. Thus, it is obligatory to flee from them on an immediate basis.
Repentance is obligatory at all times because no person is ever completely free from disobedience. Even if he is free from disobedience in action, there remains inclinations and temptations in the heart. If even that is absent, he will not be free from wiswaas (whisperings) of Shaitaan who introduces whims and thoughts which obliterate remembrance of Allah even if momentarily. Even if this, too, is absent, he will never be free of forgetfulness and falling short in knowledge of Allah, His divine attributes and His actions. All of these are shortcomings and no one is free of all of them. The difference among people is a difference only of degree. This is why the Prophet (sas) said:
ãÓáã
Åöäøóåõ áóíõÛóÇäõ Úóáóì ÞóáúÈöí æóÅöäøöí áóÃóÓúÊóÛúÝöÑõ Çááøóåó Ýöí Çáúíóæúãö ãöÇÆóÉó ãóÑøóÉò"Sometimes a shadow comes over my heart and I ask Allah's forgiveness one hundred times a day."
This is why Allah honored His Messenger (sas) with His statement:
ÇáÝÊÍ
ÅöäøóÇ ÝóÊóÍúäóÇ áóßó ÝóÊúÍðÇ ãõÈöíäðÇ(1)áöíóÛúÝöÑó áóßó Çááøóåõ ãóÇ ÊóÞóÏøóãó ãöäú ÐóäúÈößó æóãóÇ ÊóÃóÎøóÑó æóíõÊöãøó äöÚúãóÊóåõ Úóáóíúßó æóíóåúÏöíóßó ÕöÑóÇØðÇ ãõÓúÊóÞöíãðÇ(2)æóíóäúÕõÑóßó Çááøóåõ äóÕúÑðÇ ÚóÒöíÒðÇ(3){We have surely granted you a manifest victory. (1) That Allah may forgive you all of your sin which preceded and all that may follow, complete His favor upon you and guide you to the straight path. (2) And that Allah may aid you with a mighty force.}
If that is his case, what about the rest of us? Whenever the conditions of repentance are met - 1) regret, 2) cessation and 3) determination (never to return) - the repentance of a Muslim is valid and is accepted by Allah.
ÇáÔæÑì
æóåõæó ÇáøóÐöí íóÞúÈóáõ ÇáÊøóæúÈóÉó Úóäú ÚöÈóÇÏöåö æóíóÚúÝõæ Úóäö ÇáÓøóíøöÆóÇÊö æóíóÚúáóãõ ãóÇ ÊóÝúÚóáõæäó(25)æóíóÓúÊóÌöíÈõ ÇáøóÐöíäó ÁóÇãóäõæÇ æóÚóãöáõæÇ ÇáÕøóÇáöÍóÇÊö æóíóÒöíÏõåõãú ãöäú ÝóÖúáöåö æóÇáúßóÇÝöÑõæäó áóåõãú ÚóÐóÇÈñ ÔóÏöíÏñ(26){And He is the One who accepts repentance from his slaves and forgives their bad deeds and he knows all that they do. (25) And those who believe and act righteousness respond and He increases them from His generosity but for the disbelievers is a harsh punishment. (26)}
ÇáÊÑãÐí
Åöäøó Çááøóåó íóÞúÈóáõ ÊóæúÈóÉó ÇáúÚóÈúÏö ãóÇ áóãú íõÛóÑúÛöÑú"Allah accepts the repentance of his slave until al-gharghara (when the soul reaches the throat during death)."