How to play a sound once in Update?

I have a character that whenever its health is below 0.1, he dies and then a sound comes in. The problem is that the sound keeps playing every single frame instead of just once. This is the script.

public float health;
public AudioSource sound;

void Update()
{
    if(health < 0.1f)
    {
       if(!sound.isPlaying)
       {
         sound.Play();
       }
    }
}

Thanks!

create a bool isSoundPlayed. Reset the bool if the health goes back up.

You might want to use the event to check if the player health goes to 0, instead of checking on it every frame.