Class inheritance software design question

In object oriented programming there is a principle called “Composition over inheritance” which alleviate the problem of inheriting things you don’t need.
Common behavior is still convenient to inherit though and more specialized behavior could be encapsulated within components.
Interfaces can also help with keeping inheritance and composition cleaner.