Please have a look at the following article:
An Absolute Beginner's Tutorial on Dependency Inversion Principle, Inversion of Control and Dependency Injection[
^]
This will allow you to learn what DP is about.
Basically DP starts by defining a so-called interface which
defines which methods a class must implement.
Once you have defined an interface you can write classes that implement this interface.
e.g. one fake class for simulating database access
and another one for real access.