Health system widget

Hi there! Is there any possible way of making it so when my player is hit by my enemy or overlaps a widget (example a heart) will disappear and when all THREE hearts are gone it will cause game over or load level (another example: Legend of Zelda). I would really appreciate the help or any examples of how to do this.