As with any search engine hosted by someone other than yourself, you essentially have to trust their privacy policy.
DDG’s privacy policy is actually fairly simple:
We don’t save your IP address or any unique identifiers alongside your searches or visits to our websites. We also never log IP addresses or any unique identifiers to disk. This means that when you use our services, we have no way to create a history of your search queries or the sites you browse.
Assuming they’re doing what they say they’re doing, DDG is excellent for privacy.
I personally use DDG, although echo some others that you may have to be a little more specific when searching for some things to get good results. If results aren’t to my liking, I’ll use some other privacy-respecting search engines such as Brave Search and Startpage.
Their Privacy Policy page seems fairly straightforward to me:
To me these are clear claims they do not store search terms or IP addresses. Period.
Of course this is what they say. As with any third party search you have to trust they’re doing what they say.