A guy goes to a computer swap meeting in Tasmania and buys a laptop. He takes it home and finds in the laptop a directory full of child pornography. He immediately called the police, and the seller got charged. I do not feel sorry for the seller, but I do think that this example shows how much trouble a person can get into when they sell their old computers. A computer today is a notebook, a diary, a repository of your mail, your financial statements etc. It is full of personal stuff.
Now for private use, it is easy once you backup everything that you need and make sure you have everything you need, then do a full reset on your computer. What this does is erases everything on your PC and takes it back. If you have a windows 10 computer to an initial setting. It can be a bit tricker for other versions of Windows, but they all have something.
Once you have done this, you can safely sell your computer.
For businesses, it is much harder as often you are selling a computer with the business, and it has information, but the point of sale software plus much of the business software must remain operating AS IS.
So the first point is to go carefully over the computer and see what is on it. Backup everything that you think you require. Then delete as much as you can.
Now the problem is that much of the information of these files are still on your disk and a computer expert might be able to resurrect much of it.
To fix this problem download a software package CCleaner
Now I recommend here, that you uninstall your browser altogether, to clear out your browsing history and bookmarks. The new owner can put whatever he likes.
Go into the recycle bin and empty it.
Now run CCleaner.
Select tools > Diskwiper > Free Space Only
Security, I recommend Advanced overwrite 3 passes.
Pick the drives and let the computer go.
If you want something better then CCleaner or you want to make sure that it is gone, I suggest that you look at BleachBit. If the FBI could not crack Hillary Clintons computer once it had been cleaned with BleachBit, I reckon you are pretty safe. Use BleachBit to delete all the free space too including junk files.
Now your computer should be secure to sell.