In my life, kids helped me relearn what it was like to be young.
It took me a number of years to realise I had bad depression / anhedonia.
My kids helped my focus on what was important.
I accepted myself for who I am and was able to feel happy again. My kids think I'm the great wizard with technology, even if I'm considered average.
Message to OP
We can't all be famous or the best at something. We don't all have eidetic memories. You will meet those savant like personalities and they will skew your view of the world, to think that you are not capable by comparing.
Stop comparing.
You can do great things. The greatest achievement is to live a long life and to challenge yourself. Be the best you can be. Accept your limits. Use your ability to help others and take joy in that.
If you can't be Einstein or Tesla, take pride in being part of their journey.
No one will remember us. This is the norm.
The answer is people who don't know the real you. Would anyone love you if they saw a clip show of all the lies, betrayal, hypocrisy, times you yelled at your family, embarrassing fails, wasted potential, etc. But for many of us that clip show plays daily in our heads as a reminder to stop being so shitty and it comes at the price of our self-esteem.
My kids taught me both these lessons.
This. OP sounds like a great candidate for counseling/therapy from a psychologist who is a licensed counselor. It sometimes takes a few tries to find the right one, but it is worth the effort.
I stopped counting the number of times they mentioned that they considered themselves stupid. There is so much negative and toxic self critic in this post that my feeling is that this is the biggest most fundamental issue that I would look at tackling.
Once you can sit in a room by yourself and be truly happy with your own company go and be open to relationships - but not before - otherwise you're back to square one but only worse because now you have an additional reason that you will use to justify your self hate. Love yourself first. Out of that love maybe you find somebody maybe not. It doesn't matter. Out of that maybe kids can happen - or not. If you ask your partner (or worse your kids) to fix you eventually it will all come back to you. You gotta do that work in the end by yourself. Anything else is cheating.