There are two basic types of writers: those who begin already knowing how the story ends and those who don’t.
Writers who start off knowing how the story ends say things like, “Knowing where I’m going guides the whole process and keeps me focused: every scene, every character, every description is tested against the question, ‘How does this move the story toward its climax?'” This camp includes many fine writers, including (but not limited to) John Barth, Katherine Anne Porter, and Toni Morrison.
The other camp sees writing as a process of discovery. These writers include Donald Barthelme, and E. L. Doctorow. Perhaps the epitome of this approach would be Steven King, who reputedly starts by asking, “What if . . . ?” As in, “What if vampires invaded a small New England town?” And then he writes until he discovers the answer.
My point is not these particular authors or their purity as exemplars of my assertion. The point is that there is no one right or effective way to write. Either style can take you many places. Your task is to find the method that works for you.