It comes after the other stages: pre-writing activities, focusing ideas and structuring.
Example
The learners have written their first drafts, based on their notes, without thinking too much about organisation and accuracy. Then they move to the editing stage.
In the classroom
In order to optimise the opportunity for practice and noticing aspects of language use, editing can be done as a group activity, or with each learner working on another's text and then briefing the writer on the changes they suggest.
Further links:
https://www.teachingenglish.org.uk/article/writing-mini-things
https://www.teachingenglish.org.uk/article/peer-editing-correction
https://www.teachingenglish.org.uk/article/approaches-process-writing