Question: Does it tend to be better if you plan out the whole story and then write it all out, or to just start writing and see what happens?Answer:
The amount of planning (or plotting) done before the actual writing is different for every writer.
Roughly 80% of writers start with some type of outline. Sometimes this is a single paragraph. Sometimes it is ten pages. Some people fill thick notebooks with background information, character sketches, maps, plot charts, research, etc.
Then again, some writers just start writing and build the story as they go along. (I call these "pantsers," because they write by the seat of their pants.)
Some writers don't think about the end until they get there. Others find it easier to write when they know where they are going.
Both approaches have advantages and disadvantages. Pantsers are more likely to get stuck or waste time on dead ends but enjoy the thrill of discovering the story in the writing. Plotters sacrifice some spontaneity, and plotting takes time, but plotters can also solve many plot problems ahead of time and their stories often need less revision.
Of course, you can also take a hybrid approach. Start with some kind of outline so the story ideas make sense. If you get better ideas in the writing, revise your outline to make sure the new direction is better than the old before you get too far into it.
You can also write a little, then plot a little, then write a little more, etc.