There might be some problems that you can not fix on your iPhone, maybe you can reset all or parts of iPhone to see how it works.
you can just directly reset everything by going to Settings>Reset>Reset All Settings. But before this, you need to backup the important information, transfer them to a computer or just backup with iCloud keychain.
instead of reset all the settings on iPhone, I prefer to recommend reset part of the settings on iPhone.
Step 1. Go to Settings>General>Reset.
Step 2. Find Reset Network Settings in the middle of the screen.
Step 3. Tap the option and input your password.
This reset iPhone network settings could help you to clear the network settings faster.
When the GPS on your iPhone is not working, please try to reset the location and privacy.
Step 1. Go to Settings>General>Reset.
Step 2. Find Reset Location and Privacy option at the bottom.
Step 3. Tap the option and input your password.
Step 4. Open the Map and Compass on your iPhone to check if it's helpful after reset iPhone privacy and location.
This part is more powerful that the first part, it can not only reset iPhone settings but also clear the information. If you want to wipe this iPhone and Restore from other already activated iPhone.
Step 1. Go to Settings>General>Reset.
Step 2. Find Reset Erase All Content and Settings option on the top.
Step 3. Tap the option and input your password.
Now, you have finished erase you iPhone, next you need to restore your iPhone. you can choose to restore from iTunes or restore iPhone to factory settings directly.
Step 1. Open iTunes on the computer.
Step 2. Make sure your iPhone is well-connected to your computer.
Step 3. Click on the icon of your iPhone.
Step 4. Click on "Restore Backup".
Step 5. Select one of these backups, and click "Restore" to start this process.