On your iPhone or iPad, the Forgot Passcode? option appears when you have a device that uses iOS 17 or iPadOS 17 or later and you are connected to a cellular or Wi-Fi network. An Erase [Device] option appears if you have a device that uses iOS 15.2, iPadOS 15.2, iOS 16, or iPadOS 16 and you are connected to a cellular or Wi-Fi network.