Ok, I will try to give an example:
You open an habitat UI (f.e.). There, along with the other bars, stands "Hygiene" or "Cleanity", even if that is not a real word. It says 100%. As soon as you run out of a certain ressource, f.e. Disinfectation Liquid, that "Hygiene" bar will drop. And when it drops below 40%, your Kerbal has a chance of getting a disease. Now the Kerbals UI also has a bar which says "Health". Once that will drop below 50%, your Kerbal will "die", but without the death part. Which means that he wont be able to control the ship, do EVA's and so on, but if you give him medicine, his health bar will fill up again. Although when you dont give him medicine, and the bar reaches 0%, he will actually die. There is also a change that when there are other Kerbals with a sick Kerbal in a habitat, they will get the disease too. It could even transfer between habitats. As long as a Kerbal is sick, he carries the disease with him, meaning that moving between habitats wouldn't be a good idea, since that could infect other Kerbals. The best thing would be to have a medbay, but since you're a coder and not modeller, that would require some help.
I hope that you get it now, because I lost track halfway through