Even after formatting the hard disk it is possible to recover the data with the help of some recovery software because when a file is deleted, the OS removes the file from the list of files, and it shows that the space utilized by that file is now free to use for other files. However, what really happens is that the content of the file is still in the disk until it is overwritten by the creation of a new file, and this data which has not been overwritten can easily be recovered by some Software.
Hence, if we are going to sell the laptop, we should make sure that our data is completely erased and is unrecoverable from our hard disk. For this deletion, the Darik's Boot and Nuke method is highly preferred. Darik's boot and nuke is an open source project developed by Darik Horn. This program securely erases a hard disk until its data is no longer recoverable, and that is attained by overwriting the data with PRN(pseudo-random numbers) which makes it impossible to recover your data.
So first go to https://dban.org/ and download the free version( a paid version is also there which is preferred for business and organizational use and comes with some extra features).
DBAN is an ISO file, so first, you should burn the ISO file onto a CD or a USB.
Boot the PC from the USB or CD(if the PC doesn't boot from the CD, you should edit the boot order in the BIOS). Now select the disk you need to erase the data from and make sure you check that the correct disk is selected because you won't be able to recover the data after this deletion. Now choose how many times you want the disk to be overwritten, the default being 3-pass overwrite.
Now the program will erase the data from the hard-disk, and now you can either just sell the laptop with no operating system, or you can install windows and then sell to someone.
Regards,
Deepak Mathews Koshy