Jesus' statement about the unforgivable sin comes in the context of an attack from the Pharisees:
22 The experts in the law who came down from Jerusalem said, “He is possessed by Beelzebul,” and, “By the ruler of demons he casts out demons.”
They recognize that Jesus is doing the work of casting out demons, a good work, but instead of accepting this evidence as testimony about Jesus, they ascribe it to some sort of satanic 'bluff'. This is not totally illogical, it is similar to the line of reasoning Paul uses in 2 Corinthians 11:
14And no wonder, for even Satan disguises himself as an angel of light. 15So it is no surprise if his servants, also, disguise themselves as servants of righteousness. Their end will correspond to their deeds.
ESV
but it is a distortion of the reality of God's revelation, as hinted in the end of verse 15 quoted above: according to
the testimony of scripture evil cannot be hidden indefinitely and it takes an evil unbelieving heart to turn the consistent righteousness and good deeds of Jesus into a mask for evil intent. The Pharisees are ignoring scripture and the normal evidences and signs of a prophet of God: their intent is to condemn Jesus
whatever the evidence. This is the unforgivable sin, and it is impossible to convince them of their error because nothing can possibly convince them any more: they are seeing
good as evil and evil as good. If, as Jesus asserts, accepting him and his words is the only path to forgiveness, then it is logical that to permanently reject him is "unforgivable".