Go to Manage Your Content and Devices. Select your device or app from the drop-down menu. Deregister it by using the button that appears on your device or app. Confirm by selecting Deregistern again on the pop-up window.
Simply select each book one by one if you wish to handle many books in a single operation. You can then decide to deliver them to a certain Kindle device, delete them, mark them as Read, or combine them all into a collection.
If you want to register your Kindle to a different account, you need to deregister your Kindle from your current account first. To do this, go to Settings > Device Options > Deregister. Once your Kindle has been deregistered, you can then register it to the new account.