Wait at least a night, or longer if you can, before you start editing your work. Ideally, you need to forget the structure of what you have written. It is necessary to give your brain some time to relax so that when editing you could notice all illogical errors.
These errors occur when the brain is tired and attention is distracted. Therefore, when editing immediately after you finish writing, some mistakes and badly structured sentences may remain unnoticed.