A diode can be used to protect a transistor from high voltage, particularly when dealing with inductive loads. A reverse-biased diode placed across the load can absorb voltage spikes that occur when the transistor turns off, preventing damage. It is essential to ensure that the transistor has adequate voltage ratings to handle potential transients. Additionally, using a Zener diode or other protection devices can enhance safety, but they should not replace the need for properly rated transistors. Proper circuit design is crucial for effective protection against high voltage in applications like controlling an electronic lock.