"I have the advantage of knowing your habits, my dear Watson," said he. "When your round is a short one you walk, and when it is a long one you use a hansom. As I perceive that your boots, although used, are by no means dirty, I cannot doubt that you are at present busy enough to justify the hansom."
"Excellent!" I cried.
"Elementary," said he. "It is one of those instances where the reasoner can produce an effect which seems remarkable to his neighbour, because the latter has missed the one little point which is the basis of the deduction. The same may be said, my dear fellow, for the effect of some of these little sketches of yours, which is entirely meretricious, depending as it does upon your retaining in your own hands some factors in the problem which are never imparted to the reader."One of the most frustrating problems for a writer is how to portray a character who is smarter or better at something than the writer is. It's all very well to create a intelligent as Sherlock Homes, as resourceful as James Bond, or as persuasive as Horace Rumpole, but what do you do if you aren't particularly smart, resourceful, or persuasive? How can you write a dashing ladies man or irresistible siren if you have two left feet with the opposite sex? How can you write a character who could talk the hind leg off a donkey when you can't even get your kids to eat their peas?
Sir Arthur Conan Doyle "The Crooked Man" from The Memoirs of Sherlock Holmes
The simple answer is that you don't have to. The purpose of a writer isn't to be as smart, charming, or glib as his characters. The purpose is to portray the sense that the characters have these qualities.
Let's take the example of Sherlock Holmes. Conan Doyle never pretended that he was the equal in criminal detective work to his creation (though he did solve at least one mystery in real life). Though he based Holmes on one of his medical school instructors who could tell the whole history of his patients just by looking at them, Conan Doyle was never himself a master of deductive reasoning. Indeed, some have even argued that Holmes wasn't either. It's common practice for Holmesians to examine Holmes's feats of deduction and pointing out that the great detective often relied on sheer guess work, ignored equally plausible explanations, made unwarranted assumptions, and was often just plain wrong.
Perhaps, but that's irrelevant. True, things like deducing that a man is poor health because his hat is stained with sweat is pure nonsense, but that's doesn't matter because the point of Holmes's little act was never meant as a serious example of deductive reasoning. It was a literary device to convince the reader that Holmes is rather clever regardless of whether or not Conan Doyle was. The purpose was merely to establish the credibility of Holmes's superior abilities.
It's not a hard trick.Mystery writers mastered it over a century ago. You just start with the conclusion, and work backwards as you invent the clues leading up to it. Since you are essentially stacking the deck, so long as you keep your facts straight and your logic sound, you can seem like a master detective--or con man or barrister or wine expert or whatever. The wine expert is another good example. One way to create such a character is to become a wine expert. Another is to acquire a very general knowledge and spice it up with one or two fascinating little tidbits of wine trivia that make it seem as if you can tell what side of the vineyard the grapes came from just by sniffing the cork.
Glossing is another dodge. In this, you pay a great deal of a attention to setting up the problem, and great deal to how it played out, but only allude to the bit in between when someone actually had to do something. Don't have the first idea of how to chat up someone in a bar? Then don't try to depict it. Concentrate on what happened before, what happened after, and dance over the middle in such a way that you let the reader fill in the gaps.
One way that is often seen in fantasy (though not restricted to it by any means) is letting some other ability stand in for the one you can't portray. Supermen are by their very nature impossible to portray with any verisimilitude. A superior being whether saint or mutant is by their very nature going to be impossible for a lesser creature to imagine. The answer is to let some trait stand in for their abilities. That's why supermen in science fiction are often telepathic or incredibly strong and saints in fiction have a cloying kindness and sentimentality that never track with what one reads about the lives of real one. It's a substitute for what the author can't depict. The same trick is also used to depict some moral defect that a character may have that the author has trouble bringing out. It isn't just for show that Dr.No has iron claws instead of hands.