You've found the root of your entire problem right here in this post.
You know you are smart (and that's fine to know, I know objectively I am smart too). But intelligence is not wisdom. It is simply a measure of how well you CAN learn, not how much you know. The longer you live, the more you will realize that you know so very little. All of us do, no one has all the answers. Not even the greats, not Einstein, not tesla, not Elon musk, no one knows it all.
But you feel like you constantly fail, that nothing is good enough. Why is that? It's because you have conditioned yourself for outside validation. I bet, if you think about it, that you hate yourself.
But user, I can tell you right now, that you are a good person. I can tell you care about others, I can tell you are ambitious and goal driven, and I can even tell that you work hard.
I don't even know your name, and I can tell that. So why can't you see it about yourself?
That question is rhetorical, I know you probably can't explain it. But I want you to look at yourself real hard. I want you to realize that you have already accomplished many great things. You have a job, you have an education. You have a career, and goals. You have great capabilities for learning. You even have empathy to some degree.
Now you need to learn to love, starting with yourself. Write some small things down to accomplish today, even things like chores. Then look back once you've done them. They are done, right? And you did a good job? Then that's something to be proud of. That's something you and only you have accomplished. You aren't worthless, I can see the worth right now. You have to see it too, before you can truly change.