It is time-consuming but feasible if you have limited documents, photos, videos, etc. Move everything that are important to you to an external hard drive. There are mutiple options to back up your Mac: Therefore, it is a must to back up your files before erasing your MacBook or iMac.
I believe that there must be some important files on your Mac. Step 1: Back Up Your Mac Before Factory Reset