Tell us about a time when you failed to meet a goal. How did you recover from this experience?

Nobody is perfect, and at some point in your career, you may fail to achieve a goal. Interviewers ask this question to learn about how you respond to falling short of your goals, and how you respond to failure more broadly.
You should talk about how you have responded to failure in the past and used that experience to achieve a good outcome.

Example
In my last job, I was assigned to a project where I had to improve loading speeds on our web application by 10%. Unfortunately, I was unable to meet this goal by the deadline that was imposed. I underestimated the size of the task, which meant that I ended up taking on too much work at the same time.
I quickly informed my manager of the magnitude of the task and requested that more engineering resources be assigned to the project. My manager gave me another chance, and together with the new engineers I was able to meet the goal by the revised due date. This experience made me realize the importance of always setting reasonable goals, and being realistic about the size of a project.