Your characterizations will never be better than your power of observation. A human mind does not first conceive of floating abstractions and then, by means of them, recognize the concretes; in order properly to grasp an abstraction, you must derive it from concretes. To prepare your subconscious for writing proper characterization, therefore, you must be a good observer and introspector.
You constantly react to people--you approve or disapprove, like or dislike, are encourage or uneasy. You estimate emotionally everyone you meet. Learn to introspect in the sense of accounting for what in a person causes your reaction. Do not go through life saying: "I don't like X. Why? How do I know? I just don't like him." That will never make you a writer. Instead, if you feel a strong dislike for someone, then, as your artistic assignment, identify what you dislike, and by what means you observed it.
For instance, a man is rude to you, and you do not like it. What in particular is rude? Is it the implication of what the man says? Is it his voice or manner? Why do you dislike it? File this in your subconscious. Another time, you meet a man who is charming. Do not merely say: "I don't know why, but I like this man. He's wonderful." Identify: What is charming about him? How does he convey it? How did you observe it? File this away. Be being a constant, conscious valuer of people, you gather the material from which you will draw your future characterizations.
If you have learned a great many abstractions that yo have not yet connected to concretes, do the reverse. For instance, if you decide that you favor independence, observe which words or gestures or manners of people convey independence to you. And, conversely, observe what conveys dependence. What conveys honesty? What conveys dishonesty? You can observe these characteristics only by their outward manifestations--by the words, actions, gestures, and subtler mannerisms of people.
When your subconscious is stocked with such well-filed material--when you concretes are filed under the proper abstractions and your abstractions are amply illustrated by concretes--then you can approach an assignment such as "present a characterization of Roark." And then, if you tell yourself that he is independent, honest, and just, your subconscious will throw at you the kind of concretes that make you feel, while writing a scene: "Yes, Roark would say this, but he would not say that."
The best, most natural dialogue is usually written as if the writer is listening to dictation. You might get stuck on any particular point and have to question yourself; but normally, dialogue writes itself. You have an idea of the scene, and when you write, the dialogue "just comes" to you---exactly as, in a conversation, your own answers come to you. That is, you speak from your premises, knowledge, and estimate of the situation.
In writing dialogue, you must react on two or more premises. As Roark, you speak from a certain premise; as Keating, you say something else. Your mind must know the connection between certain abstractions and their concrete expressions so well that you can write for three or five or any number of people, constantly switching premises in your mind. You cannot do this by conscious intention. You must reach the stage where the process feels "instinctive"---where, the moment when you speak for Roark, you have a sense of what he would say, and when Keating has to answer, you have a sense of what he would say.
This sudden "feel" of a character is not a mystical talent. In the process of writing, you feel that you "just know" what Roark or Keating would say; but this feeling means only that your understanding of the premises involved has become automatic.
When I wrote the Roark-Keating scen, I did not think consciously of those implications of each line that I explained earlier. But when I write a line inspirationally, I can tell myself why it is in character, and why another line would be out of character. To judge the objective validity of what you write, you must be able afterward to tell yourself why a given line is right for one character (what it conveys) and why something else is right for another character (what is conveys). After the writing, you must be able to do the kind of analysis I did of the Roark-Keating scene.