1. Go to the SCCM setup folder cd D:\Program Files\Microsoft Configuration Manager\cd.latest\SMSSETUP\TOOLS\ContentLibraryCleanup
  2. Run the Check

ContentLibraryCleanup.exe / dp NameoftheDPServer

More info about the tool :

https://learn.microsoft.com/en-us/mem/configmgr/core/plan-design/hierarchy/content-library-cleanup-tool

By Nizar