Killing an entity if it has custom model data

How would I go about killing an item if it has the custom model data I am looking for. I am making a new smithing table upgrade and it works but when I break it with the items inside it will drop the completed item and all the components because it hasnt been taken out yet so I was going to make it so that if the armor stand that allows the table to works has a tag that is it crafting it will delete the completed drop on break and only drop the components but I dont know how to kill an entity with a custom model data if thats even possible.

I didnt post any code because its not an issue with the code I have but rather a question if its possible to kill entities based off of custom model data or not. I am assuming there is a way since the item still has the model data when it is an entity on the ground I just cant figure it out

Continue to help post