It's located in the Character's tab, first sub-tab that is opened when you open Character.
You can click on an item that you want to lock. This will disable the "Destroy for Painite or Gems". Locked items are not destroyed when clicking the "Destroy All Unlocked Items" so make sure to lock every item that you don't want to destroy in your inventory before clicking the button.
Equipment that you've got equipped won't be destroyed unless you unequip them. Their lock state will save if you equip/unequip them. If you want to lock equipped items, you'd need to unequip them, lock them and equip them back on.
Purchased items like Beast Whistle can't be locked, but they are not destroyed with the option as they can not be destroyed.