Focusing DoF?

How does the Focusing Depth of Field work? I seen it before but me in general never got it to work and the only way I can get it to work is to just keep a far distance blurry and that’s it.

Example: When the camera focuses on something the DoF effect kicks in and when its not the effect isn’t present.