We don't help with password issues because we can't be sure of proof of ownership. If you take it to a professional PC fixer and prove you recently bought it, they may be able to help.
If you asked the seller for the password and they didn't know it, you must consider you've bought stolen property. The fixer would be able to identify the previous owner. Take the PC and that information to the Police and they'll probably get your money back.
The password is there to protect the user's personal data so if you buy a new version of Windows 10 from Microsoft, you could install that over the existing system and trhat also wipes those data off the disk.