It really depends on how you have structured things. Say your health logic is stored in your player script. Any time you take damage or heal (i.e. the health changes), you could send a message to your health GUI script to notify about the change.
msg.post("gui_address_here", "player_health_update", {new_health = health})
Then in the on_message function of your GUI script you’d have something like:
if message_id == hash("player_health_update") then
update_health_graphic(message.new_health)
end
In this case update_health_graphic() is a function that does whatever is necessary to update the GUI graphics to whatever value is passed by message.new_health.