How to delete a device handler

I keep trying to delete a device handler and it keeps popping up a mess of red wording. please help . Also there is a switch tied to it called shop lights and another one that is switch endpoint 2. I want both of them gone I can not do it for some reason

Delete the switches first in the app then delete the DH in the IDE.