How do you remove the broken links from your website?
Use broken link check to spot the broken links in your website.
Redirect the broken link to the valid page.
Also build a custom 404 page and redirect visitors when they visit non existing pages.
If the links are broken and it is showing 404 errors then what you can do is to 301 redirect to home page or other similar page, it would help in SEO too.