You need to correctly configure your 404 error page because you don't want a negative signal from Google
A 404 error pages flashes on the screen when a server fails to access the requested URL because it no longer exists on the server. Think of an old home address of a friend who already moved away--no one's home, so you are getting a 404 error message. This happens when a page has moved when a URL restructuring occurs, and internal links were not modified to adapt to this change, or when URLs or pages are deleted. If your website has broken links or missing pages, visitors to your site will likely encounter these pages. It is important to configure your 404 error pages correctly to maintain a positive user experience for every visitor that comes to your site.
Your 404 error page is important because, in the event that changes to your URL lead to broken or lost pages, users are informed why the URL they are trying to locate doesn't work. Timely information given this way can help mitigate any negative experience users get when they encounter lost or broken links in your site.
You also need to correctly configure your 404 error page because you don't want a negative signal from Google. When Google is trying to access a resource that has been moved or deleted, and it doesn't get the correct 404 error code saying that the URL is no longer available, it sends out a negative signal. While this isn't exactly a ground for penalties or lower rankings from Google, this is still a reflection of your website's poor quality, which can affect future user experience.
The correct configuration of a 404 error code is also crucial if you don't want users to go straight back to the Google search page or close the browser after your disappointing offering. If you must show a 404 error page, make sure you include options redirecting them back to your home page, to your Contact page, or to the page most likely to give them the help they need.
The right error code configuration can help you maintain your website's quality and make the browsing experience easier for users. Besides making sure that all-important URLs are accessible to users, the correct configuration of 404 error pages means you are giving users the right kind of information, keeping them in your site long enough for you to direct them to the information they are looking for.