You'll remember that in The Scarlet Letter, when Hester commits adultery, she refuses to name the father of her unborn child. It is Dimmesdale that argues, after Pearl's (the baby's) birth, that Hester should be allowed to remain in the community as her mother.
When Hester's long-lost husband, Chillingworth, appears in disguise, he befriends Dimmesdale, though they are very different, and with his knowledge and background, passes himself off as a physician. (His intent is revenge on the man that Hester was unfaithful with.) Dimmesdale is unwell, often putting his hand to his heart; his guilt eats away at him over the years, for his is the father of Hester's child.
At one point (while Dimmesdale is in a deep--perhaps drugged--sleep), Chillingworth examines the minister; seeing something beneath the sick man's shirt, Chillingworth's need for revenge and his hatred intensify.
By this time, Pearl is seven. Hester talks to Chillingworth and asks him to stop tormenting Dimmesdale, realizing why her "husband" is staying so close to the minister. Chillingworth refuses, so Hester tells Chillingworth's secret to Dimmesdale, and the couple agree to leave, taking Pearl with them, to start a new life. Chillingworth discovers their plan.
The pair now know they will never be free of Chillingworth. As he leaves the church after services, suddenly, Dimmesdale's vitality leaves him, and clutching at Hester and Pearl, he confesses his part in Hester's fall from grace, shows the mark hidden beneath his shirt, which looks like an "A," and Dimmesdale dies.
The "A" he "wears" ties him to the adulterous affair with Hester, though she had never disclosed his identity in all the years in which she lived as an outcast in this Puritan environment.