Move your mouse so your character follows you, don't let the water touch the red line. You win when the numbers hit 0, that means you are safe.
Credit to @Scratch-1106 for the art style from his original project: https://scratch.mit.edu/projects/1045437751/