To function optimally, an organism needs to ensure that its internal physical and chemical state is balanced. Maintaining this balance requires the action of many regulatory mechanisms. The immune response plays an important role in maintaining homeostasis by preparing the body to fight off infection, and to help the healing process.