Go to settings→ devices → select a device →settings → delete. For Z-wave devices you need to set the device in exclusion mode. It is not needed for Zigbee devices. If a Z-wave device does not have contact with the hub, select "force delete" instead of "delete". For more information, seearticle on exclusion.