Dimmesdale's declining health foreshadows his eventual death from a guilty conscience. One example of this foreshadowing occurs in a moment of dramatic irony in Chapter 8, when the narrator describes the townspeople's reaction to Chillingworth's interest in Dimmesdale:
It was understood that this learned man was the physician as well as friend of the young minister, whose health had severely suffered, of late, by his too unreserved self-sacrifice to the labors and duties of the pastoral relation.
Everyone assumes that the doctor takes an interest in the pastor because Dimmesdale's health is suffering. There is dramatic irony in this assumption because it is true, but not for the reasons the townspeople believe. Chillingworth is interested in Dimmesdale because his failing health signals to the doctor that he is hiding something. Chillingworth cozies up to the ailing man because he believes him to be Pearl's father. The fact that Dimmesdale's body shows the signs of his guilty conscience hints at the fact that in the end, a guilty conscience may just be able to destroy him.
Additionally significant to both the dramatic irony and the foreshadowing here is the townspeople's assumption that Dimmesdale's health is suffering because he is an overcommitted minister. They are not technically wrong that Dimmesdale's job is causing him to suffer. But his suffering isn't due to the fact that the job is too much of an administrative burden. Rather, his "labors and duties" cause him to sicken and eventually die because he cannot perform them in good conscience while he is hiding is own sinfulness. Neither Chillingworth nor the townspeople are entirely right or entirely wrong about the cause of Dimmesdale's ailment. His health problems and eventual death are the result of combined factors: he could have survived either his adultery with Hester or his job as a minister, but he can't deal with the ongoing tension between his public virtue and private sin.
Dimmesdale and Chillingworth's relationship in the novel is built around dramatic irony: Chillingworth knows that Dimmesdale is Pearl's father, but Dimmesdale does not know that Chillingworth his Hester's estranged husband. In Chapter 14, Chillingworth tells Hester how this uneven knowledge has been impacting Dimmesdale:
"He knew, by some spiritual sense,—for the Creator never made another being so sensitive as this,—he knew that no friendly hand was pulling at his heart-strings, and that an eye was looking curiously into him, which sought only evil, and found it. But he knew not that the eye and hand were mine!"
Chillingworth tells Hester that he hasn't done anything to Dimmesdale and that, in fact, he has saved his life by keeping his own identity a secret. Still, Dimmesdale's health has been deteriorating on its own because he senses himself caught in some hostile "eye and hand." The dramatic irony, which Chillingworth notes is at play in their dynamic, almost seems to make Dimmesdale's torture more painful. The narrator has already revealed that Dimmesdale regularly inflicts pain on his own body as punishment for his sin. Chillingworth is right that Dimmesdale is sensitive: he is so sensitive, in fact, that he has turned his own "eye and hand" against himself. Dimmesdale is locked in his own head with his own shame, and Chillingworth withholds the chance for Dimmesdale to turn his "eye and hand" against an outside enemy. If Dimmesdale knew that he was engaged directly in a conflict with his doctor, Dimmesdale could not only fight off that opponent, but he could also release himself from the burden of keeping his adultery a secret. Chillingworth's relish in the dramatic irony underscores his role as a conniving villain who delights in psychological torture, even as he professes to have saved Dimmesdale's life.
Dramatic irony also adds to a sense of the occult in the novel. Does Dimmesdale somehow sense Chillingworth's identity, and is that contributing to his health problems? Hawthorne does not fully answer this question. It is entirely possible to interpret Dimmesdale's health problems as the result of his self-punishment and the extreme stress he feels to keep his sins a secret. But just as people sometimes sense a certain mystici sm about Pearl that might or might not be real, it is also possible to imagine that Dimmesdale's health is suffering from some sort of curse Chillingworth has placed on him. Within the world of the novel, Chillingworth's association with Indigenous medicine supports the possibility that something magical is afoot. Hawthorne and many other white people have long held racist ideas about Indigenous people and the occult. Hawthorne allows the reader to wonder whether Chillingworth's "captivity" transformed him into some kind of evil magician.