When a person goes against Allah’s orders (which are conveyed by His messenger), this person has sinned. The worst sin is blasphemy, which is caused by any belief, saying, or action that contradicts Islam. When a person becomes Muslim he leaves all blasphemy. A Muslim must learn about all the types of blasphemy so to avoid committing any of them as he proceeds through life. If a Muslim commits blasphemy, he becomes non-Muslim and must become Muslim again. If he dies without becoming a Muslim, he will be in Hell forever in the Hereafter. If a Muslim commits a sin which is less than blasphemy and dies without repenting to Allah of the sin, then this sin is counted against him on the Day of Judgment. Similarly, if a Muslim follows Allah’s orders, in obedience to Him, this is counted in his favor. All of this is known by Allah and no thing escapes Him.
When a Muslim commits sins, he must repent of them immediately. To repent of blasphemy, one must utter the Testification of Faith, clearing himself of the committed blasphemy. The Testification of Faith (Shahadatan) can be stated as follows:
“I testify that no one is God but Allah, and I testify that Muhammad is the Messenger of Allah.”
For a sin less than blasphemy, one must stop doing the sin, regret having done it, and have the intention not to commit the same sin again. If the sin is stealing from a person, for example, then the stolen goods must be returned in addition. Allah is ever-merciful to the Muslim and no matter how many times he sins in his life, if he stops it, regrets having done it, and intends not to do it again, he will be forgiven by Allah. But for those who are non-Muslim, no matter what good things they do, those deeds are not to their credit in the Hereafter; they must first become Muslim.
A few examples of blasphemy are: believing that Allah has a son, worshipping an idol, and saying that Allah does not know everything. Some examples of sins less than blasphemy are: killing a person unjustly, adultery, drinking alcohol, and stealing. When a Muslim makes sincere repentance as was described, it is as if he did not sin, in that he will not be punished for what he repented of, for Allah is ever-merciful to the Muslims. Also, when a person becomes a Muslim for the first time, Allah forgives all his past sins.