In what ways can the judiciary maintain its independence while also engaging constructively with other branches of government?

Justice Bhuyan said the judiciary should not be an eternal critic or cheerleader. I want to understand how the judiciary can balance its role so that it remains independent but still works well with the legislature and executive.