I had a friend that took some pills and committed suicide. But right before he died he asked for forgiveness. I was just wondering if that is a forgivable sin since he asked for forgiveness or even though he asked for forgiveness is he not forgiven?
I am so sorry about your loss, especially since it was due to such a needless and senseless action. There are many reasons that people give for committing suicide; none are justified, but one thing is certain, suicide never solved a single problem.
When someone commits suicide, those left behind are left with many questions. "Would he still be alive if I had noticed sooner?" "Was I to blame for his death?" But often the reality is that each person must face the consequences of their own actions. "For we must all appear before the judgment seat of Christ, that each one may receive the things done in the body, according to what he has done, whether good or bad" (II Corinthians 5:10). Each of us want to think the best of those whom we have lost. We don't want to think ill of the dead. Yet, often we build a fantasy picture of the past. The truth is replaced with a myth of our own making. However, truth ought to be faced because we can learn lessons even from the mistakes others have made. Just as the Bible records the failings of man, we can learn that some decisions have bad outcomes. "Now these things became our examples, to the intent that we should not lust after evil things as they also lusted. And do not become idolaters as were some of them. As it is written, "The people sat down to eat and drink, and rose up to play." Nor let us commit sexual immorality, as some of them did, and in one day twenty-three thousand fell; nor let us tempt Christ, as some of them also tempted, and were destroyed by serpents; nor complain, as some of them also complained, and were destroyed by the destroyer. Now all these things happened to them as examples, and they were written for our admonition, upon whom the ends of the ages have come. Therefore let him who thinks he stands take heed lest he fall" (I Corinthians 10:6-12).
The Roman Catholic church is noted for their stance that suicide is an unforgivable sin. In some sense they are right. In I John 5:16-17, John tells us there are some sins which lead to death. See the article "A Sin Leading to Death" for a complete discussion of this passage. A short summary is that any sin for which a person is unrepentant and unacknowledged is a sin that leads to spiritual death. By its very nature, suicide, which is a form of murder, makes it difficult to repent of and ask God forgiveness as John instructed. "If we confess our sins, He is faithful and just to forgive us our sins and to cleanse us from all unrighteousness" (I John 1:9). But we cannot make a blanket statement that suicide is unforgiveable. There are many who nearly succeed, but are snatched back from the jaws of death. When such a person turns their back on the sin that they attempted, they are forgiven, just as any other sinner is forgiven.
In answer to your particular question about your friend, I am unable to give the final answer. I was not there and even if I was present, I would not have the ability to determine the sincerity of your friend's heart. That something that God alone can carefully and correctly weigh. As Paul said, "For I know nothing against myself, yet I am not justified by this; but He who judges me is the Lord. Therefore judge nothing before the time, until the Lord comes, who will both bring to light the hidden things of darkness and reveal the counsels of the hearts. Then each one's praise will come from God" (I Corinthians 4:4-5).
What I can tell you is what God has revealed that each of us must do in order to be saved. Your friend's life has ended. His destiny is sealed. "It is appointed for men to die once, but after this the judgment" (Hebrews 9:27). But your life still lies wide open before you. Do not throw away what God's has given you, but use your life to His glory. I invite you to read the article "What Must I Do to Go to Heaven?" for more information.