You really pose two distinct questions about Joseph Conrad’s Heart of Darkness, so I’ll answer your question in two parts:
1) The most obvious connection between madness and physical illness can be found in the character of Kurtz, who suffers from an unnamed tropical fever and succumbs to it at the end of the novella. When Marlow encounters Kurtz, he is emaciated and reduced to a hollow shell of his former self. He is haunted by his past, infatuated with collecting ivory and brutalizes the Natives. After Kurtz’s death, Marlow is given the dead man’s official report for the International Society for the Suppression of Savage Customs and is impressed by its eloquence and precision. At the end of the writing though, a postscript is scrawled reading “Exterminate all the Brutes!” This small detail is just one of several examples tracing Kurtz’s mysterious descent into savagery. Whether his physical illness or mental illness came first is up for debate, which brings us to your second question.
2) Your second question gets to the heart of a primary theme of the novella. One of Marlow’s primary obsessions is with the enigmatic relationship between the environment of the Congo and the evils he witnessed there. To Marlow, it seems that the darkness of the environment itself is a source of brutality and evil. The jungle is described as “the heart of impenetrable darkness” and “malevolent” among many other negative descriptions. The implication of this imagery is that, for a European at least, to spend time in the dark jungles of the Congo is to risk losing their sanity and even humanity.
Kurtz, once again, is a primary example of the negative impacts of one's environment can have, even on promising men. Kurtz is described by many as a Renaissance man with a bright future in politics and business. He was a painter, a poet, and a philosopher who “enlarged the mind” of all he met. However, with just a few months of isolation in the jungle, Kurtz has transformed into a ruthless monster who decorates the boundaries of his cabin with decapitated heads. The environment in Heart of Darkness plays a major role in the madness experienced by many of the characters in the novel, and this theme is best embodied in the character of Kurtz.