Hi-
Go to Settings > General
Scroll down to bottom
Choose Transfer or Reset Phone
Two choices- Reset or Erase All Content and Settings.
If you choose Reset, you can choose what to Reset (eg. all settings, network settings etc)
If you choose Erase, you will get told that you're going to wipe your phone back to box fresh (ready to be sold etc). This is what people mean by a 'factory reset' usually
It's not super clear but I believe 'Reset All Settings' restores your iPhone settings to factory default settings, just like a new iPhone, but without deleting any other data or contents on your iPhone. So, your personal data, including photos, videos, apps, and documents, remains untouched.
Hope this helps