Well, some things are easier to save than others.
Files (music, photos, videos, etc.) can be saved to a SD card, a cloud or google account, a computer, etc. The same goes for contacts, data files, etc.
Apps, however, cannot be saved. So any apps you have installed would be wiped and once the phone is reset you would have to reinstall said apps.
This is while I mentioned saving data files. For 'some' apps, you can save the files that are with them that hold the data the app uses. Not all have or allow this, so it is hit and miss, but you can go through the phone's file manager app to locate them. Or connect the phone to a computer via USB cord and then search for the files through the computer.
In regard to messages. Well if you...