Some writers like to plan while others prefer to just make it all up as they go along. There is no “right” way to write – whatever helps you tell your story.
Those that like to discover the story as they write it are sometimes called discovery writers or in more common parlance, pantsers (because they fly by the seat of their pants). While the polar opposite of a pantser is the plotter who like to know what story they are telling before they start.
Me, I do a little of both.
What about you?