The first thing you need to do is figure out what you want to write about. There are several genres, which are categories that many stories will fall into. Genres include Science Fiction, Fantasy, Realistic Fiction, Romance, Horror, Mystery, Historical Fiction, etc.
The second thing you have to do is decide on the characters. This step takes a while, so don't feel rushed. You need to devote time to what your characters look like, where they live, what they do in their world, and their strengths and weaknesses (i.e. Rainbow Dash is competitive and loyal, but she brags a lot) . Remember that, when you write your story's exposition, that it's better to show your character's personality rather than tell about it. This will keep their attention and make them want to learn more. You should take time to make your protagonist (main character), antagonist (against the main character), supporting characters, and foils.
Next, develop your setting. The setting includes the time at which the story is taking place and the world that your character lives in. Remember that your reader will want to see the world the main character lives in, and you should devote time to building that world. This is especially true in things like Fantasy and Science Fiction. The world isn't necessarily equivalent to our own, so you can be creative and make it your own.
The fourth thing you should do is develop a plot. The plot is the thing that will keep the reader going, and there is no story without one. First, think of the problem your character will face. It could be as big as saving the world from the evil villain (Harry Potter), as complex as surviving on your own when people are trying hard to kill you (Hunger Games), or even as simple as fitting in at school (Diary of a Wimpy Kid). Remember, the problem can evolve over time, and it isn't restricted to these examples. You could have your character survive the apocalyptic war between good and evil, or have him/her spy on the government under the threat of being caught and killed. Be creative with your problem! You must also remember the parts of a plot: exposition, rising action, climax, falling acton, resolution. The exposition will be the first few chapters, introducing characters in realistic situations (Harry goes to Hogwarts and discovers how wizard school works). The rising action will be the start of the problem (the Sorcerer's Stone will be stolen, and Harry must stop it). The climax is always the most exciting part of the story, and the story must end quickly after it (Professor Quirrel reveals himself, Voldemort tries to stop Harry). The falling action is the stuff that finishes up the plot, followed by thr resolution, where the problem is solved (Harry saves the Stone, everything is explained by Dumbledore, and he goes home to deal with his Muggle family). Remember that the easiest thing to do is write down chapter-by-chapter notes of what will happen.
Next, develop subplots. These are the little stories in-between that entertain the reader as the plot takes time to develop. It can be anything, from a mystery to a sports event to some romance. For example, in Harry Potter, subplots include Quiddich matches, romance between Ron and Hermione, Draco being a bully to Harry, going to Hagrid's, and attending classes. These small details don't really add to the plot, and are often cut out completely in movie adaptions, but are quite entertaining and offer some humor while investing the reader's attention. Also, to enhance the reader's experience, you should probably add a memorable moral.
Now, start writing the book. This may take weeks to months to years, so don't feel rushed. A good book takes time and effort. Choose your point-of-view: third-person (he, she, it), second-person (you, your, you're) or first-person (I, me, my). Write a rough draft of your book. This will be your guide for the final copy. If you write yourself into a dead end, take out the part of the story that forced it and rewrite it. If you don't want to write or are out of ideas, wait until tomorrow, and hopefully your writer's block will be gone. To help, you can suck on a peppermint or listen to an instrumental that fits the current part of the plot's mood to help you think. When you write your rough draft and feel satisfied with things such as the dialouge and plotline, you can do the next step.
Next, revise! This will (hopefully) reduce your chances of plotholes and inconsistencies that confuse the reader (Warriors: The Last Hope had almost nothing but plotholes, like StarClan not knowing the Fourth at the beginning of the book, and yet knowing who it was at the end. It wasn't really necessary for them to just be able to tell the cats when the cats could have done it alone and grow from it. I was confused as to how that all worked out). Try to pretend you haven't read your book before, and start from there. It can also help to show your draft to close friends to see if they end up confused, invested, bored, or enjoying it.
Do your characters stay all throughout the story? When they disappear, is it with a good reason? Do they randomly appear in certain parts of the book? Remember to fix this, as a character randomly appearing or disappering will confuse the reader.
Does your character look or act the same as he/she has at the beginning of the story? (This is a pain in Warriors, where the cats randomly change fur color/eye color/names, and everyone fights on which cat looks like what.) When does the appearance change, and is it with reason? Is it permanent? Does the character change for a reason? Does he grow by the end of the book? These are all things to look at when editing your characters.
Does the subplot or new element stay until the end? If it drops off and does nothing, it won't make sense to a reader as to why you included it.
Did the problem get solved? And if it did, was it solved in a satisfying way? A reader will want to see the evil villain get defeated in an epic and satisfying way, giving them a joyous thing to think about whenever they talk about the book or series. The Deathly Hallows was one of J.K. Rowling's longest books, but at the end of the book, when Harry finally defeats Voldemort, it is well deserved and the reader is cheering and screaming and praising Harry for the amazing battle won. Or, maybe that was just me.
Were you consistent with your writing? When you started, did you write "Chapter One" and end up with "10" chapters later? Did you end each chapter with a cliffhanger to keep the reader on their toes? Consistency may not be as important as other things, but it will help you in the end.
Does a certain scene matter to your story? Does it drive the story, flesh out the plot, make the reader keep going, or develop a character? If the answer to all of these is "no," then you can cut out the scene entirely.
Remember to fix the small continuity errors you find in your book and mark off the big problems in your book. For example, a little error could be appearance, but a big error could be using a character that seems to be really important in one scene, yet never using him again for the rest of the book.
Now, edit your story. Fix all of your spelling, convention, and grammatical errors. If you don't know how to spell something, look it up on Dictionary.com. Take your story to an editor so that they can help you with fixing it. Edit sentences in your story. For example, change "the clear sky" into "the clear, radiant, bright, sunny sky." See how much more interesting that sounds? Also, change words up a bit. Instead of using the word "said" every time your character speaks (like The Magic Treehouse, making it sound redundant), use words like "replied" or "sighed." This implies much more emotion and is better to use than boring old "said."
Next, rewrite your story. Type out your story so that it looks neater, and remember to include all of the edits you have made. This will be the final copy, and you want it to dazzle. Be sure to check that all of your characters are in-character, and spell-check when you finish.
Now, develop a book cover. What will it look like? Will you draw it yourself or have someone else do it? These are all things to ask when thinking about your cover, the most eye-catching part of the book. Another thing to ask is if your book will have a map. It only needs one if your story revolves around an alternate world or a travel story, but it will help your reader to not get confused (But only add maps to the necessary area. In Guardians of Ga'Hoole, the maps confused me even more).
Finally, publish your book. Send a copy to a company like Scholastic, and wait to see if they accept it. If they don't, don't get discouraged. Many companies may not. If you can't find a willing company, you can get your book self-published. If you're not ready, save up some money and try again in a few years. Just don't share your book with a stranger, because they can copy and publish your book and you won't ever get it back.