The first thing you want to try is the Reset This PC option. If this does not solve your problems, the way forward be would be to either clean install Windows or to restore the factory image.
If you're getting rid of an old Windows 10 computer, it's important to completely wipe your data so no one else can access it. That's where factory reset comes in ...