A theme is the functional equivalent of glue that holds all of the elements of your story together. No matter what's happening with your characters on the surface, there's a common thread running beneath that unites them and--through the development and escalation of chapter events--infers your premise that crime doesn't pay, love conquers all or absence makes the heart grow fonder.
Understand the difference between themes, plots and genres. A theme is a core message, belief or life lesson that you want to impart to your readers. A plot is the context in which you plan to demonstrate the consequences of the message. A genre refers to the category of literature that best addresses the tone of the story; i.e., comedy, drama or romance. Most themes are predicated on the quest for reward, revenge or escape or a combination of these.
Make a list of 5 to 10 beliefs that you are passionate about and have enough familiarity with that you could use them as the cornerstone of a story or novel. For example, perhaps your family went through difficult times but that everything always seemed to work out whenever you turned to prayer. Another belief might be that someone who wronged you once and broke your heart has a likelihood of doing it again. Perhaps one of the items on your list is even the silly observation that cats will always gravitate to the one person in the room who dislikes felines or is allergic.
Pick the belief or observation from your list in Step 2 that you believe lends itself the best to further development. For the purposes of this article, let's say you decide to go with your statement about cats and their pesky persistence. Assess what you think the cat's motivations are. Perhaps you believe cats do this because they purposely like annoying people. Then again, maybe you see cats as desperately craving the affection of everyone in the room in order to feel happy and complete.
Identify how the belief you chose in Step 3 transcends to the broader context of human relationships and interactions. For instance, individuals who constantly follow us around, ask questions and invade our personal space cause us agitation, which then leads to anger. Conversely, that which is aloof and mysterious captures our curiosity and attention because we can't imagine what it is that could possibly be more interesting to them than us. In the case of the cat, someone who ignores her presence is worthy of pursuit because, frankly, everyone else in the room is much too easy a mark.
Translate this last observation to a single statement that can either be original or a popular idiom, moral or aphorism. The websites listed in the resources section of this article may assist you with this exercise. In the case of the cat analogy, you might write something like, "anything worth having is worth fighting for," "familiarity breeds contempt" or "the secret of success is constancy to purpose." The statement you come up with will be the theme of your story.
Tape the statement in a place where you can see it as you write your book. With each scene and chapter, ask yourself whether what you have written relates to the core theme you have identified by either contesting it or giving it validation. This will keep you from wandering off message over the course of the writing.
Incorporate symbolism and parallelism throughout your text to subliminally reinforce the theme. For example, perhaps your young female character is completely infatuated with the dashing hero but he won't even give her the time of day. Let's bring the cat back into the equation. This young woman has a beloved kitty that's always trying to get one of the heroine's best pals to pet her. She doesn't see why the friend doesn't just give in because poor Fluffy is obviously sincere and trying hard to be friends. At this point the reader realizes that she hasn't figured out that the same dynamic is going on with the dashing swain whose heart she's trying to win. One day the cat is nowhere to be found because she has a new catnip toy and is off entertaining herself in another room. The gal pal becomes curious as to why the cat's not in the room trying to jump in her lap the way she always does. Maybe she even gets up in concern to go look for it. And that's when the young woman realizes that there's a lesson that can be learned here about the laws of attraction.