I (usually) only edit when the entire work is finished. My current novel was written before I lost it when my computer failed so I've been rewriting and editing as I go. I can do this because I already know how things play out and what needs to happen at certain points.
After I finish a rough draft, I go through and make sure it makes sense/no plotlines were dropped/no characters changed names halfway through (I have a problem with minor characters switching up names lol)
Then I can make sure my character's dialogue is consistent to them through out the novel and that it flows correctly.
Then I do a light sweep through for grammar/typos before I send it to my beta reader.
My beta reader double check my plots/characters/etc makes sense. I correct anything they point out then I do a stricter pass through for typos/grammar.
At that point it's going to be as best it can get without being sent a professional editor.