How do I improve my rough script until it becomes a coherent and consistent tight plot?

As someone who's just starting to write and also take writing a story seriously for once, I have always found it difficult to synthesise and process my ideas, concepts, characters and story beats and produce a tight plot where every single ingredient in the story influences the next without leaving much room for disconnected or completely irrelevant material.

How do writers normally take steps to refine their work until the plot seems almost perfect and all the concepts and characters, as well as their actions, all fit nicely together to sequentially drive the story forward to keep the viewer/reader hooked?