Structural, substantive or macro editing is done at an earlier stage, even when you’re still writing and/or organizing the text. It is about big-picture changes and it might include rewriting.
Stylistic or line editing is usually the following step and is focused on clarity. It may involve reordering paragraphs, sentences and words, eliminating unnecessary words, reworking prose, smoothing out sentences and transitions, untangling complicated clauses, eliminating internal inconsistencies, finding the appropriate tone for the audience, etc.
If your text is already finished and just needs to be polished, what you might need is copy editing. This stage involves more mechanical work, checking grammar, punctuation, spelling, and ensuring that the text follows any required style guidelines such as APA or the Chicago Manual of Style.
Proofreading is done on texts that have been already edited. It looks at details such as typos, spelling errors, mistakes in punctuation that might have been overlooked, etc.