Factory reset will not save your files, and if you want to save all your files, passwords and apps, you should to recovery it like Guilbert53 said.
Of course, if you have done a system restore before, and you make sure it can make your Windows 10 run smoothly, you can also do a system restore for it.
There is another way you can do is reinstall Windows 10 by a USB bootable device, when in Windows setup, you should choose the first option of:
Upgrade: Install Windows and keep files, settings and applications.
Here is the tutorial to install Windows 10:
https://www.howtogeek.com/197559/how-to-install-windows-10-on-your-pc/
And I think you mean that your Windows 10 is freeze often. So at first, you can try to clean your Windows 10 to see if it can run fast than before.
https://windows10skill.com/pc-freezes-slow-on-windows-10/
Wish it can help.