The order that works
Markup first, CSS second, JS last and usually deleted. Each step is verified before the next, so a failure is localized to one file.
When the refactor is not worth it
If the component is only reachable from one page and that page can be redesigned, redesign the page. A component nobody links to does not need to be made accessible.