This is a good question because there often are no clearly defined lines between stages of the writing process. Pre-writing is generally a preliminary stage in which the writer jots down ideas about the subject about which he or she will write, the purpose of writing, the form of the writing, and the audience to whom the writing is directed. Quite often, this stage will be messy and consist of ideas, words, and phrases. That is fine!
There is no magical order to these steps, and some of these steps will be accomplished in stages. You might want to think about audience before you consider your topic. or you might have already been told what form the essay must take, for example, an argumentative essay or a compare and contrast paper. Even when you decide on a subject, after thinking about it, you might decide the subject is too big and have to narrow it a bit. For example, if your subject is the economy, it is going to be difficult to write a three-page paper on that subject. You will quickly figure out that you need to focus on just one aspect of the economy. The idea is to have some idea what your main idea might be, the point to writing the paper, the form the paper will take, and the audience you are trying to reach.
Once you have a pre-writing plan, you can use that plan to state your main idea (thesis statement) and decide how you will support that idea. If research is necessary, you will need to accomplish that next. Your research should enable you to decide what points you wish to make to support your main idea and what evidence will help you support these. Even if you do not need to do research, you still need to consider how you will support your main idea.
Then you need to organize your ideas and materials with graphic mapping, a list, or an outline. Once this is accomplished, you are ready to write a first draft. You should be aware, though, that sometimes when you write a first draft, you find logical flaws in your ideas or you happen upon a better idea than you started with. This is why it's just a draft, not something fixed in stone. This is also why experts recommend that you not fuss about grammar, spelling, and punctuation as you write drafts. Much of what you write might change in the revision process, and all the time spent on those details will have been wasted.