How to make my sprite eat food (health bar included)

Hi I need help making a system where my sprite eats the food and it respawns and the health bar goes back to full