Almost any web server software you use will have an option for you to specify where users go when they request a page that does not exist. This is the familiar 404 error. You want to handle this error gracefully for several reasons. First it is more user friendly and keeps people from having the impression that your site is broken. Most people won't blame themselves for not typing in a URL correctly, they will just assume you are not very professional. Another great reason is that it prevents hackers from being able to get information from an error page that you didn't design. The information that a typical "Page Not Found" page contains is not earth shattering, but we should always try to deny the bad guys whatever they are looking to get. Information is their first priority.
Depending on your web server software you will have to go and do different things to setup what your website should do when a non-existent page is requested, but in most cases it is just a setting. Some people will create a page that lets the user know that they asked for a page that either has never or no longer exists and this gives the added benefit if done well of giving the user all the navigation needed to get back to your site and buy or see or do something that is the reason you built the site in the first place. The other viable alternative is to just set the home page of the site as the destination when a 404 error occurs. This might annoy some users, but it should get them back on track to do what you want them to do fast. Of course if you are bold enough to try this technique, you better be very sure you don't have any broken links on your site as going in a circle will cause people to frustrate out very quickly and gives you no easy way to get real data of how many people are requesting pages that don't exist.