If the iPhone shows Unavailable with no Forgot Passcode? option in the bottom-right corner, you'll have to connect it to a computer through Recovery Mode and restore it from there.
If you forgot your iPhone passcode or your iPhone is disabled - Apple Support
If it does show the Forgot Passcode? option, this would be the easier method allowing you to erase the iPhone with simply your Apple Account passcode without the need for a computer. This option only shows sometimes as a number of requirements must be met, such as an active Wi-Fi or cellular connection and Find My having been enabled.
If you see a iPhone, iPad, or Apple Vision Pro unavailable message or Security Lockout screen - Apple Support
Once either method is completed, your iPhone should be at the Hello screen which would indicate the iPhone has been fully erased to factory settings. If you want to set up the iPhone again without a restoration, when you get to the Transfer Apps and Data step, select Don't Transfer Anything.