I was given an older phone in the past, reset it, and it unexpectedly asked for a passcode that I didn't know. I managed to fix that one with an app on my laptop. Now I bought an older iPhone—possibly an iPhone X—and replaced both the battery and the screen, so I've already invested money in it. After resetting it, it is asking for a numeric lock-screen passcode again. The phone sometimes charges, but my laptop and its management software never detect it. Is there a legitimate way to reset and use it, or have I wasted my money?
2 Answers
First confirm that the cable supports data, not just charging, and check the charging port for lint or damage. If the computer still cannot recognize the phone, enter recovery mode while connecting it and attempt the restore again. A hardware problem with the port or the repairs could also prevent detection.
If it is asking for a numeric lock-screen passcode, the usual solution is to place the iPhone into recovery mode and restore it with a computer. This erases everything on the phone, including the forgotten passcode. Use a known-good data cable and try another USB port or computer if it is not detected. If the phone is still linked to someone else’s Apple account after the restore, that is Activation Lock and only the previous owner can remove it; a reset cannot bypass that.

Related Questions
Lenovo Thinkpad Stuck In Update Loop Install FilterDriverU2_Reload