Start here. This is the direct spoken answer to practice first.
Overview
Inheritance is strongest when it models a stable behavioral relationship and weakest when it exists only to reuse a few methods.
Inheritance is appropriate when the subtype is genuinely a kind of the base type and can honor the base contract everywhere the base is expected. A subtype may specialize behavior, but it should not reject valid base inputs, weaken guarantees, or make ordinary base operations meaningless. In Java, a class has one direct superclass, so choosing inheritance also commits it to a hierarchy. If the relationship is only uses-a or needs-some-code-from, composition is usually clearer.