Is failure avoidance a good thing?

I occasionally see people on here advising someone who has failed repeatedly at something ro "try and keep trying" which I think is often very bad advice.

People who experience repeated failures experience repeated disappointments, and often have depression and poor self-esteem as a result.

Why put yourself through this?

Is failure avoidance a good thing?
Post Opinion