"Wherefore I say unto you, All manner of sin and blasphemy shall be forgiven unto men: but the blasphemy against the Holy Ghost shall not be forgiven unto men." Matthew 12:31 KJV
As our Lord Jesus said, all sin can be forgiven of men but there are sins against the Holy Spirit which cannot be forgiven of men.
All sin is a clear statement or action contrary to the will of God and if done knowingly, it is a challenge to the very authority of God. All sin must be repented of, because the wages of sin is death, but as our Lord Jesus said, there are sins against the Holy Spirit which cannot be forgiven of men.
There are six closely related examples of sins against the Holy Spirit mentioned in the Bible which cannot be forgiven, and as the The Holy Spirit is a definite person, it follows that He can be sinned against.
Regarding these six examples, blasphemy against the Holy Spirit is the sin that most people think about (Matthew 12:31). When reading of just how harshly and seriously Jesus warns against doing this unpardonable sin, some will even get the feeling and the fear that they may have done this in the past.
To better understand what it means to sin against the Holy Spirit, let us look at the six examples of sin against the Holy Spirit given in the Bible:
Blasphemy against the Holy Spirit - It is deliberately rejecting Christ, rejecting His message and gift of salvation. Reference: Matthew 12:31 KJV and commentary.
Lying to or tempting the Holy Spirit - As brought to us in detail in the story of the greed of Ananias and Sapphira in secretly withholding a part of the price of the land which was sold to provide money to be held in common interest by all. Reference: Acts 5: 4-9 KJV and commentary.
Despising the Holy Spirit - Exceeding rejection of Christ by verbally and actively discounting Christ to others and ridiculing to all that His blood sacrifice counts for nothing. Actively working to discourage or terminate another's belief in Christ. Reference: Hebrews 10:29 KJV and commentary.
Resisting or striving with the Holy Spirit - Choosing to resist the promptings (the convicting of the Holy Spirit to convince you of your sinfulness) of the Holy spirit as he judges. Man was given 120 years after the warning of the coming judgement of the great flood before it actually occurred. During that time that the Lord's Spirit (the Holy Spirit) judged and convicted them of their sinfulness, yet only Noah (means "rest") and his family responded and moved with that conviction. In similar manner, if we resist or continue to resist the promptings of the Holy Spirit, we do so at great peril. Reference: Genesis 6:3 KJV and commentary.
Vexing or grieving the Holy Spirit - Making the Holy Spirit weary with you. That sounds impossible, or too simple, but remember how Israel would win battles when they did not grieve the Lord with their all too common disobedience, and of how they would lose battles and eventually lose their nation when they did grieve God. Also, immediately preceding the Immanuel Prophecy (Isaiah 7:14) there is a good example of the word "weary" (grieve) is given in Isaiah 7:13, where Isaiah answers king Ahaz: "Is it a small thing for you to weary men, but you weary my God also?". Reference: Isaiah 7:13, 63:10 and Ephesians 4:30 KJV and commentary.
Quenching the Holy Spirit - Very similar to resisting the Holy Spirit, but in the sense of hindering His promptings so as to suppress them. Reference: 1 Thessalonians: 5:19 KJV and commentary.
When comparing these examples to one another, a clear and central theme emerges: they are all varying degrees of "disbelief". ("But without faith, it is impossible to please God;" Hebrews 11:6)
So how does one know for sure as to if they have committed blasphemy against the Holy Spirit in the past? There is a simple answer to that: When a person has committed the unpardonable sin, the Holy Spirit ceases to work within that person to convict them of their sins.
The mere fact that you question as to whether you may have committed this sin in the past testifies to the fact that He is still with you and you are still within the reach of God's Grace.