What does it mean?
Failing at an activity just means that you are not performing how you want to. For example, you started to paint, but feel you failed as an artist because your paintings are nothing close to the work of Leonardo DaVinci. To be honest, failing an activity doesn't really exist. Yeah, maybe you could be objectively new, but everyone starts from somewhere. Just because you learn at a different pace or started from a different angle does mean you are bad at it. If you think that you need to give up an activity, make sure it wasn't because you felt you weren't good enough.
Why do we feel this way?
Have you ever done something, but stopped doing it because you were bad at it? Almost everyone has. We've been conditioned to only enjoy activities we can profit off of. Obviously, you can't profit off of something you're bad at. For example, you can't get on to the national soccer team if you're terrible at soccer. However, this doesn't mean you should give up soccer completely. It takes athletes years of training to get to that level, so you shouldn't give up. If you want to play for fun, don't feel pressured to be amazing. Hobbies are an important part of life, and you shouldn't stop doing something you love because you're afraid of looking bad.
How to overcome this feeling
If you are "bad" at an activity you enjoy, just keep doing it. Be happy that you have a hobby, and don't pressure yourself to be world-class. Refusing to do things you're not good at only reinforces the idea that perfectionism is the only way to obtain happiness. This is a really bad way of thinking, and it'll only lead to self-hate. You don't need to be perfect to be happy. Start being content with how you are now because that's the only way you'll be content with your life.