Before doing so, keep in mind that a restoration to factory settings will erase all the information and settings on your iPhone.
If you want to restore your iPhone 12 to factory settings you have to follow these simple steps:
1. Press Settings> General> Reset
2. Press Erase All Content and Settings
3. Enter your Apple ID password or your code
4. Confirm Erase Device
This action may take several minutes.
After restoring to factory settings, the device will reboot and you will have to configure it as if you just bought it.