Using Update function vs other functions to keep track of state between scripts?

Say I have a script with the following code:

void Update() {
    healthText.text = player.health;
}

Is it ok to do this instead of having something like this in my Player script:

public Health {
    set {
        //logic
        UpdateHeathUI();
    }
}

The first one is much easier, but I don’t know if having that in the Update function is expensive or not.

In general, you should only use Update() for stuff that really needs to be calculated each frame, like this optimization guide by Unity also suggests. What it does not tell you is that even if you do virtually nothing in your Update method, just the overhead of calling it from native engine code is quite high.

At the end, performance optimization is always a question of how much you gain for what investment, but in this case, I personally avoid having unnecessary Update() methods and unnecessary code in Update() methods at all cost.