The secret to writing is rewriting. If you aspire to math and computer science, try thinking like a scientist. (I am a research scientist using both math and computer science).
A story is much like a program; you are trying to evoke certain emotions from the reader with each scene. If your program doesn't work after you write it, you must debug it, and change it, until it does work. But you can't change it at random and hope it will work, you need to understand what went wrong and fix THAT.
Do the same thing with your story. If you know there are plot holes: I assure they were not on the blank page you began with. Which means you made your characters do something that resulted in the plot hole. Go find that bug, and fix it, and if you have to, start changing what follows so the effects of that bug are gone. No more plot hole!
Now you can fix the part after the bug in several ways; one is with slight modifications of what they do or know. If the plot hole bug was in CH3, then in CH4 and after, change their decisions, so they aren't based on something that isn't in CH3 anymore.
Another is by introducing a transition scene. If your plot hole bug was in CH3, and now CH4 is messed up, you can write CH3.5 to get your characters into the same place as CH4 but by a different route; now that the bug is fixed.
Or you can scrap it, and write from the bug forward. Put CH4 and after in another file, so you can scavenge writing from it, but after fixing CH3 start again with a new CH4 that flows from CH3.
I am a discovery writer, meaning I do NOT plan out a plot, mostly when I write I have a description of an ending in mind (which can change). It is a written description, usually half a page that will turn into 30 or 40 pages. So I can write myself into dead ends, and this is what I do: Find the bug, scrap stuff and start over.
Every day when I write, I begin by reading at least what I wrote yesterday, usually from the beginning of the scene I am working on, or if I am starting a scene, I read the entire previous scene I wrote. After a night of sleep and other work, I can read that with more objectivity and see what needs to be fixed, and I will fix it if I don't like it. That might mean I write very little that day, or nothing at all, but what I am doing is part of writing, getting it right, and I am making progress by doing it.
Imagine you want to lay a deck of cards, perfectly aligned end-to-end, down the hallway. The fastest way to do that is not to scatter all the cards in the hallway about where you think they will go, and then start aligning #2 to #1, and then #3 to #2, and so on. If you did it that way, by the time you get to aligning #12 to #11, nothing is in the right place, it is too far or too close, and it is all out of kilter. You wasted all that time up front trying to make a rough placement.
The fastest way to get done is to put #1 down, then #2, then #3, until you are done, each perfectly aligned. Now think of those cards as your scenes.
Write the first scene, and rewrite until you get it right. Then write the second scene, and rewrite that until you get it right, and reading scene 1 then scene 2 feels right. Don't worry about how long they are; a scene lasts until something irrevocable happens (good, bad, or minor; for example a scene may end when somebody decides they are going home for the night).
That is when the next scene begins, perhaps just after a passage of time (they arrive at work again the next day), or perhaps as they decide how to deal with the irrevocable event (for example they accidentally killed somebody with their car).
That is how you progress, through a short story, a novella, a full novel, a series. Every scene has a conflict. Keep in mind the (provisional) ending, keep making it difficult for your protagonists, all the other writing advice holds. But the main thing is: Always keep it coherent and sensible as you write, you should never have to discard a huge amount of work, just two or three scenes at most (and you can keep them in your junk pile in case you want to cut and paste something from them).