404 page solution

Please, i have problem that the number of pages 404 not found are increasing as a result of some products go to draft due to update as the seller not still or remove it.

So i want a solution for that as increasing 404 pages not found will affect my website seo performance ⬇

Can i have a tool which remove these pages from my site directly just when it went to draft