Pacemaker pulses are very low voltage; ICD pulses are however up to 1000V and although not very much Joule, it is a very unpleasant feeling if you experience it when extracting an ICD from an expired person.
Therefore it is preferred to switch the device off with a programmer.
If not available, you should wear isolating gloves and use the donut shaped magnet to temporarily disable the device. Then cut off the wires as close to the ICD as possible. Then remove the magnet (device is active again).
If a donut magnet is not available, use isolating gloves and an isolated cutting tool.
Keep others away from the body while extracting.
Store the (still active) ICD in a dry place and return it to the pacemaker/ICD centre for readout or disposal.