I cannot stress enough how important it is that you So many people do this, and it is one of the biggest SEO mistakes that you can make on your entire site. When you set your product to draft or archived without doing anything else with it, the page is gone, the URL doesn't work anymore, and what you're telling search engines is that your site gives the poor user experience and that it's no longer relevant to the searches that that product would have ranked for.
This is the absolute worst thing you can do, because any SEO benefits that page might have, whether it's rankings, topical authority, internal links, are all just being screwed up and thrown out the window. What you actually want to do is redirect that traffic somewhere else and tell search engines that's where they should with the rankings, traffic, authority, whatever it might have built up.
When you set your product pages to draft or archived without doing anything else with them first, you're effectively cutting off all of that traffic right at the source.