In this episode of the book (it's almost at the end of Chapter X), Chillingworth tells Dimmesdale that his illness is due to a problem with his soul. He says there is something wrong with Dimmesdale's spirit and that the problem is showing itself in Dimmesdale's body.
Because the problem is with Dimmesdale's soul and not his body, Chillingworth tries to treat it (though it's not clear he really wants to help Dimmesdale) by talkiing to him. It's sort of like he's doing psychotherapy with him. He tells Dimmesdale that he will have to open his heart to Chillingworth.
Would you, therefore, that your physician heal the bodily
evil? How may this be unless you first lay open to him the wound
or trouble in your soul?"