Health bar

does anyone know how to make a health bar?
like if an enemy attackes you you lose life
and when it gets to zero you die:smirk: