According to the users manual
RESTORING FACTORY SETTINGS
Follow the steps below to reset all settings and the camera’s password, and
unregister the camera from your GoPro Plus account. This option is useful if
you are reselling your camera and want to reset it to its original state.
1. From the main screen, swipe down.
2. Tap Preferences > Factory Reset, and then tap Reset.