Every story has a protagonist. Every story has an antagonist. Just how villainous your antagonist is, depends on the circumstances in the story. Both the protagonist and antagonist often have a character that they turn to for advice. Someone they trust to help them. That character is the character I call the Wise Character. The wise character is the one who knows just what wisdom to impart to help the hero/heroine or the villain, depending. How do you write such a character?
To begin with, you have to know what kind of advice the protagonist needs. Then you can develop a character who is either super smart all around, or simply an expert in the subject the protagonist needs help with. Developing the character will mean giving him or her a backstory that includes a degree, perhaps, or some other way of attaining the knowledge that will help the protagonist or antagonist, whichever seeks the help.
You might only need a character who says something profound every now and then that assists the protagonist. Or you may need the genius working for the antagonist that must be stopped along with the antagonist. Either way, you need to create the character with a backstory that provides his knowledge in a logical (to the story) way.
Think of creating the character as a survival strategy. What do you need? Is the question. There is also what do you have, and that only applies in a limited way. If you look at what your characters need and what they have, you may find that you already have a character that can fit the bill. All you would have to do is tweak the character with the required expertise.
If you don’t have a character ready to take on the role of advisor, or the Wise Character, you will need to create one from scratch. That’s not as hard as it sounds. You just have to create a character with the right background to provide the protagonist (or antagonist) with what he/she needs to move the story forward. It doesn’t even have to be a main character. It can be a minor character who only appears a few times in the story. The Wise Character should appear more than once, though. If it only appears once, or is never mentioned until needed, it becomes a transparent plot device. Mentioning the character a few times before it appears to impart its advice is allowable. The character must be established as a Wise Character before it appears though. That is what makes it more believable.
Creating a Wise Character is not that hard as long as you do the backstory correctly. The Wise Character doesn’t have to be a mystical being, it just has to be someone with the expertise to guide the protagonist (or antagonist) to its goal.