Getting into a locked iPhone can be tricky. The best approach is to use the Apple ID and password originally associated with the device. If that's not possible, a factory reset is an option, but it will erase all data. Have you perhaps forgotten your Apple ID credentials, or are you dealing with someone else's phone? It's important to remember privacy and legal concerns here. What specific issue are you facing with the locked iPhone?