A 404 error is an HTTP response code stating that the browser was able to connect to the server but could not find the page in question.
404 errors are more common with websites that have a lot of web pages and have to constantly undergo maintenance.
404 errors in SEO are risky because there is a high chance that the website is going to lose a lot of page rank value depending on the number of errors.
Taking search engines like Google, Having a 404 error for a page that no longer exists causes Google to delete its indexing for the webpage and subsequently remove page rank on all the links pointing towards the webpage hence making the links useless.
Losing the PageRank value on the links causes the website to lose all the potential traffic it might gain from those links.
Fixing 404 errors in SEO has only one answer, which is using as many 301 redirects as possible.
Redirection, in general, retains 90-99% link equity(ranking power) the links pointing to the websites won't end up becoming useless immediately.
Although this is to be take in consideration that 301 redirects should be taken in relevance to the webpage with the 404 error, as using 301 redirects blindly could result in losing traffic.
If you have too many 404 errors, there are two ways that you can use 404 errors in SEO
Bulk redirect consists of taking every web page and redirecting them towards the main homepage
Selective redirect consists of downloading all the backlinks of your website then proceeding to select the ones that are the most important. After you select the most important backlinks for your website, proceed to redirect them.