What is cortisol, its production, role, and imbalances?

Could you explain how cortisol is produced and its role?