How do you do that, though? After all, you can't access the Settings menu to do it, and there's nothing else you can do whilst confined to the lock screen. Thankfully, there's a way through this, though it includes having to go through your phone's recovery — a limited boot mode that is independent of your Android OS (for most intents and purposes). Typically, it's used to flash (or install) system updates and wipe data when talking the built-in version available with your device out of the box, though you can actually install a third-party, custom recovery with more features and better functionality.
Since installing a custom recovery isn't exactly like downloading an app from the Play Store, it should come as good news that you don't actually need one to reclaim ownership of your device, and you can just use the recovery already available with your phone. Here's how to do it:
* NOTE: Some smartphones -may- have protection built into their recovery, making this method invalid.