There are several threads in the kindle developer's corner forum that cover details of this.
What you need to do is execute some linux commands inside your kindle. You can do that with a RUNME.sh script, or with an SSH session.
The commands you need (from diagnostics) are:
idme -d --bootmode main
rm -f /mnt/us/ENABLE_DIAGS
reboot
The threads that contain details are:
Select Boot:
https://www.mobileread.com/forums/sho...d.php?t=169645
Simple Debricking:
https://www.mobileread.com/forums/sho...d.php?t=170929