This is why I love the "find usages" inspection, though the IDE (at least JetBrains ones) will usually preemptively warn you about unused methods and functions.
If it's a block of logic in the middle of a function that you suspect is no longer needed, set a breakpoint in it and run the program before deleting it just to make sure it's not being triggered.