There are several messages sent by Hawthorne on this subject.
When Dimmesdale forgives Hester, he also forgives himself for the tortures under which he enslaved himself in order to conceal his true feelings. This was an act of both love and liberation on his part.
Hester similarly forgives herself and Dimmesdale even though he denied her and basically abandoned her, and she brings forward the famous words "“Thou shalt forgive me! Let God punish! Thou shalt forgive!”
In addition to this, Dimmesdale brings forward the paradigm that Chillingworth is actually the true sinner out of the three, because something done out of evil and in a premeditated course is worst than something done out of passion. Hence, he does blame someone, the true person who does harm, and he begins there to try and re-make his life.
The lesson about forgiveness is best seen in the life of Roger Chillingworth. When he learns of Hester's adultery, he chooses to devote his life to revenge. His wrath becomes obsession as he spends his days and nights seeking the identity of Hester's partner in sin. When he confirms his suspicion that it is Dimmesdale who fathered Pearl, Chillingworth torments the young minister psychologically and, on one occasion, prevents him from confessing in order to free himself from his sin and guilt. Furthermore, Chillingworth becomes so absolutely morally depraved that he deliberately uses his healing skills as a physician to destroy Dimmesdale's health. As Dimmesdale fails in body and spirit, Chillingworth watches and rejoices in his suffering.
Before he became obsessed with revenge, Chillingworth had been a scholar and a respected physician. By the end of his life, he had become a monster. As he descended into his own spiritual destruction, Chillingworth's physical appearance changes until he becomes an ugly, frightening figure to behold. The townspeople see the striking difference in Chillingworth's physical appearance and are repelled by him. The inference can be drawn that Chillingworth's outer physical appearance reflects his growing spiritual corruption.
When Dimmesdale finally does make a public confession and seek forgiveness, he frees himself from sin and guilt, and he also frees himself from Chillingworth's revenge. The old physician then is left alone, without purpose, and soon dies. Before his death, however, he leaves his estate to Pearl, the one innocent victim in the whole affair. Chillingworth realized at the end of his life that he needed forgiveness for himself.