it is controlled by negative feedback loop.Let's say you have high glucose level in your blood,that will be registered and pancreas will produce more insulin to keep it in the normal range.Therefore by negative feedback loop it will regulate homeostasis