In chapter 10 ofThe Scarlet Letter,titled "The Leech and his Patient", Roger Chillingworth tries very hard, through persuasive as well as through allegorical language, to get Arthur Dimmesdale to tell him the truth about what is really causing his physical decline. Chillingworth is aware that something inside Reverend Dimmesdale is eating him up and manifesting itself in the Reverend's weakening body.
At one point, Dimmesdale gets so upset at Chillingworth's prying questions that he blows up in a rage, citing that his illness is spiritual and that the only one who could save him is not an earthly doctor, but God, himself. At this point, Dimmesdale leaves the room for a few hours.
The narrator then explains that the reason why Dimmesdale returns back is basically twofold. First, because Dimmesdale felt remorseful at his sudden reaction. Let us not forget that Dimmesdale is a man ridden by guilt but, nevertheless, he is not necessarily a mean nor violent man. Since Chillingworth never once lost his nerve and maintained his image of a willing and helpful man, Dimmesdale felt guilty and thought of himself as a very unfair man to someone whose main job is to help him. The second reason is implied in the novel; Dimmesdale knows that he will never tell anybody what exactly is eating him up inside. Moreover, Chillingworth may grow more and more suspicious since this "ailment" is obviously now making Dimmesdale lose his temper. Why not just keep the friendship going with Chillingworth since there is nothing to lose?
The young clergyman, after a few hours of privacy, was sensible that the disorder of his nerves had hurried him into an unseemly outbreak of temper, which there had been nothing in the physician's words to excuse or palliate.
Therefore it is a combination of guilt and the need to continue this front of friendship with Chillingworth (in order to avoid more suspicion) that led Dimmesdale to have a change of heart.