My experience (both first and third-hand) is that being terrible to work/play/exist around often comes from not realizing what being around you feels like from the other side. Working with an asshole will go some ways towards fixing that. In the meantime, learning how to deal with them will make you recognize your own habits and maybe find ways to mitigate or fix them.
You can also find personality or career coaches, etc. They're just a bit pricy.
We can debate neurodiversity and range of personality vs. dysfunction and "unfortunate," but the truth of the matter is some people do things that make them hard to work with and will make them hard to work with in any setting. Some examples might be as simple as interrupting and not letting anyone else speak, or always saying no, or never thanking people and always criticizing, and so forth. If you've never met one of these people then I'm happy for you, but they're not rare in tech. We're all a little mad here, as the old cliche almost goes.
I really have no idea what the OP's issues are that they were asking about--for all I know they think they're terrible to work with because of an inferiority or confidence issue. But my advice stands: get some perspective by reading about other people terrible to work with. Either you'll find out you're not so bad or you'll get the right input to tweak your own behavior.
I appreciate your advice too, but not everyone has to skills or opportunity to "freelance or job-hop" until they find something that works, and the idea that everyone needs to accommodate you while you find the right fit is laughable in the real world. We're not bricks but we're expected to supply our own glue code between us and everyone else, at least to the halfway point, and it's downright narcissistic to expect otherwise. And tight settings like Silicon Valley, you'd be surprised how easy it is to get a reputation as an asshole or team liability while you learn to do that if you're not crisp about it.
For 90% of the people out there, some small tweaks to behavior in order to learn to play the game is the right answer. I'm glad you've apparently found an alternate route to success, but I wouldn't dismiss the typical ways either.
And, to answer a maybe obvious question, no the book isn't about manipulating people. It's more about dealing quirks of human nature and being excellent at negotiating and interacting with people. Can't recommend it enough if you're honestly looking to improve in that sphere.