Before DI, let's first understand IOC.
Inversion of Control (IOC) is a generic term that means objects do not create other objects on which they rely to do their work. Instead, they get the objects that they need from an outside source.
One of the analogy is Hollywood Principle i.e. Don’t call us, we’ll call you!!
DI is a form of IOC or an implementation to support IOC or subset of IOC, where dependencies are passed through constructors/ setters/ methods/ interfaces.
If this helps to address the issue, please close the thread by accepting the answer.