The Taxonomy Term Deletion Check module checks if the taxonomy term is
associated to a node or a child term prior to deletion.
The checking occurs when you are in the edit term page. If the selected
term is associated to a node or a term, the delete button is disabled
(greyed out - as shown in the screenshot) with an explanation on the side.
Note: This module only prevents the deletion of a term in the UI, it will
not react to programmatically deleted terms.