If it’s a Kindle Paperwhite with a forgotten lock-screen passcode, Amazon’s supported method is to factory-reset it directly from the passcode screen:
Tap the passcode field.
Enter 111222777.
Tap OK.
The Kindle should reset itself and remove the passcode.
Important: this erases the Kindle's locally stored content, personal information, registration, and settings. Books purchased through Amazon can generally be downloaded again after you sign back into the same Amazon account, but locally stored personal documents that aren't backed up may be lost.
https://www.amazon.com/gp/help/customer/display.html?nodeId=GV3ESZM3CABSBR87