Can anyone explain how to create an underwater breath meter so it will go down when underwater and back up when out of water, and player died if it reaches 0 underwater?

I set players health variable and his health goes to 0 at timer countdown but he still don’t die, he just walks around with 0 health.