Story is, at its core, a metaphor for how to live. We live vicariously through the characters we see on the page or the screen. So it follows that if you're creating characters, they should be as real as possible. That is, of course, easier said than done, and a weak or unbelievable character can kill a screenplay or movie regardless of the plot (experimental film excepted). So what can be done? For writers, an understanding of psychology and human nature are vital in order to see people as they are, making it possible to make up people who are more like people than like characters.
Freud casts a long shadow over western culture. To paraphrase a famous quote, all modern psychological theory is but a series of footnotes and reactions to Freud, who, along with William James and other pioneers, posited the existence, and importance, of the subconscious in human motive. Interestingly, the plays of Shakespeare, which feature acute portrayals of psychology, are among the most enduring and popular, both then and now (especially in the age of psychoanalysis, and he was writing hundreds of years before).
Freud's work was picked up by artists, who saw in the unconscious an analog to the "madness" revered by the Ancient Greeks; even the arch rationalist Plato said, roughly, that anyone who tried to write a poem without being a little off was not going to write a good poem. So what does this mean for us, as writers? Well, odds are you are doing this (that is, crafting characters psychologically) without thinking about it; but frequently, we writers have no idea that we're doing what we're doing, and even worse, why we're doing it.
E.M. Forster, the British novelist, spoke of "flat" and "round" characters. According to him, each had their place within a story. The flat character is the two-dimensional man or woman who has no inner depth. They say things because that's what is needed, not because they need to say them. A round character is, like a human, a mess of contradictions, a human being full of contradictory desires that pull the story along, and if they are drawn correctly, they can seem more real than the people we meet in the street. Knowing all this, then, why do so many screenplays feature characters who seem to do nothing except move the plot along?
Is this Id?
The Id, according to Freud, is the monster that lurks within us, all desire and selfish need; think Alex in A Clockwork Orange. He is, by all objective standards, a monster, yet we identify with him because Kubrick, and Malcolm McDowell, make him into the most alive character in the film's world, where everyone else is a lifeless, drab caricature. A character driven by Id does what we cannot, and lives in a way that we cannot. Hence, the appeal of the villain. Tony Montana is another example of a socially irresponsible dude who is also a hero to millions. But where Kubrick subverts the narrative and has Alex triumph (implicating the audience in a way not found in the novel upon which the movie is based), Oliver Stone's screenplay does what audiences demand, which is to show that the Id, unchecked, will lead a character to no good end.
A character driven by their Id, primarily, is actually not that complicated, closer to flat than round. They want things, and they take them. They work, but when we add other dimensions, characters become more than just surrogates, they become us.
Super Ego, Maniacs, & Conflict
Freud posited that in order to keep the Id in check, people develop a superego, which acts as a sort of authority figure/policeman. And what is the basis of drama? That's right. Conflict. We cannot do what we want to, all the time. Think about this in your own life. What we want, versus what we can do, is a huge part of our day to day experience. It makes us human, and giving your characters these conflicts is vital. So create a character who is in conflict with their id and you have instant conflict. And an interesting character. A character who has an active id, yet finds themselves in conflict with their superego and ego (or, in a vast oversimplification, the conscious part of our personality).
Another thing to consider is that many times, writers tend to use themselves as a model for the main character in the work they're writing. This is normal, but can sometimes lead to being too easy on the protagonist. And that is not a recipe for an interesting story. Have you ever read a story where the main character went through the story, confronting problems which, while vexing, were easily solved? Did that story captivate your imagination? Odds are, no.
Think about your own life: when all is well, you tend to adhere to the status quo. After all, why mess with a good thing? But the foundation of narrative is drama, and drama is trouble. Story is nothing more and nothing less than the universe out of balance, and the attempts to set it right (whether successful or unsuccessful. And the universe out of order can be anything, but it has to be bad, because only if it's dire will the crucible of circumstance burn away all the niceties of a character's external self and leave the core; that means that your character has to undergo the worst thing possible, and then something even worse than that, and so on; how they react is the story. Have you ever been writing and found yourself surprised by a character's actions? Then you're on the right track.
Why So Serious?
Modern, western people are not, in general, super happy. Which is weird! Because we live longer than we ever have, the average middle-class person in western Europe, the U.S., or any part of the so-called first world, provided with an average income has a standard of living better than any medieval king (to list but a few boons of the modern age: indoor plumbing, heat and air conditioning, refrigeration of food, vaccines, far less threat of violence in daily life, etc.) And yet, we are not a happy lot. In fact, humanity is more alienated and miserable than ever. So if you're happy, well, you know, you should, like, get with the program.
The reasons for this are manifold, but the theme of the century has been alienation, and alienation stems from a lack of coherence; the modern world is confusing, and story is no longer able to guide us, at least in a profound way. Art depicts life as disjointed; we are not connected to each other or to our work (writers excepted), and we worry constantly. I think it has something to do with the fact that the central fear, the main motivating factor in every human being, is a fear of death. It is the one universal experience that is a total mystery, and without the comfort of religion to explain things, people are left adrift in a world where science and consumerism become the new faith, and yet they are unable to provide any comfort to the vast majority of people, who, as Freud said, depended on religion.
Add to this the mechanization of death (WWI caused shockwaves in the arts that can still be felt; that nightmarish conflict gave us surrealism, Dada, and what we think of as the avant-garde, as well as the modern world.) In literature, it delivered the protagonists of Hemingway, conflicted and numb, and Camus' The Stranger, totally alienated from himself and experience. Film noir is a direct descendant of this new attitude towards life. No longer were things clear. In this new world, we have infinite choice, and infinite freedom, but also an infinite responsibility for the meaning (or meaninglessness) of our lives.
Modern characters, no matter the conflict of their story, were wrestling with the mystery of death and finding no peace. It follows, then, that one could say every story is a metaphor for death, and, since the invention of nuclear weapons and the possibility of total destruction of the species, a certain nihilism has crept into human affairs. God's apocalypse was replaced with man's, and again, this absurd situation, that we could bring about our own annihilation for no reason other than some twisted logic, was too much for the psyche to bear. Which is why the one movie that captures the insanity of the situation so well is Dr. Strangelove, another Kubrick film. He realized that in the face of such insanity, the only reaction was insanity. You can't play the apocalypse straight. But I digress.
It can be useful, when writing, to use the techniques of Stanislavski, the great Russian actor and teacher and exponent of "sense memory," the practice of not acting a scene, but living it, through careful reconstruction of sensory detail. Interestingly, Stanislavski was not influenced by Freud so much as a 1910 book called The Psychology of Emotions (the link points to an online copy), written by one Theodule Ribot. There are parallels between Freud and Stanislavski, though. The superego can be compared to Stanislavski's "superobjective," or the overriding goal of a character that, more than anything, guides them. The Id could also be seen to find its place in the "subtext" of a work, as the hidden emotions of the character, the words behind the words, so to speak.
Before Stanislavski's methods made their way into the mainstream, film acting was more of a surface affair; in Hollywood, you can see the change in performance happen almost overnight, when his indirect disciples, Marlon Brando and James Dean, brought a new form of "realism" to the screen; at the time, it shocked audiences; today, anything else is considered hopelessly hokey. Some people even think that this sort of technique is dangerous for the psyche, because of the danger that an actor can plumb too deep, to levels where they are (to complete the metaphor) out of their depth.
In a sense, you have to be heartbroken to write heartbreak; that doesn't mean crying, but it does mean remembering what it feels like, in all its dimensions. And you have to have the fearlessness to throw your character into the pit of life; classic, favorite characters are ones who confront life, wrestle with death, go toe to toe with the big questions, even if the questions are posed sideways, as metaphor (which is usually the case). Every obstacle is more than itself; each one stands for the "big" questions, and the story you're telling is, in the end, nothing more or less than the story of the character wrestling with these obstacles and revealing their true selves in the process as they progress towards their goal (and the end).
Our lives are stories. The more we learn to see what motivates us as the protagonist in our lives, and the more we interrogate our motives, the more realistic our characters will be. We say, in figures of speech, that a true thing "resonates," and that falsehoods don't ring true; a truth is something you can't ignore, a ringing bell. And if writing is a way to find out who you are, then the more we know about ourselves, the more likely it is that the people we write will be more people than characters.