Forgiveness of sins requires repentance (contrition). The Catechism of the Catholic Church states, "Among the penitent’s acts, contrition occupies first place. Contrition is sorrow of the soul and detestation for the sin committed, together with the resolution not to sin again" (CCC 1451).
Unwillingness to repent and accept God’s forgiveness is what Jesus was talking about when he referred to "blasphemy of the Spirit" (Matt. 12:31-32). The Catechism explains, "By rejecting grace in this life, one already judges oneself, receives according to one’s works, and can even condemn oneself for all eternity by rejecting the Spirit of love" (CCC 679).