In MacOS Big Sur and later, the secure transports (DNS over HTTPS, and over TLS) are supported by the operating system.
Paul Miller has a blog post describing their usage, linking to his GitHub page of suggested configuration profiles. To install on MacOS, go to your Profiles preference pane, and choose one of these profiles from there, as described by Apple on their support page.
Here, I quote Miller's profile for Google DoH:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>DNSSettings</key>
<dict>
<key>DNSProtocol</key>
<string>HTTPS</string>
<key>ServerAddresses</key>
<array>
<string>2001:4860:4860::8888</string>
<string>2001:4860:4860::8844</string>
<string>8.8.8.8</string>
<string>8.8.4.4</string>
</array>
<key>ServerURL</key>
<string>https://dns.google/dns-query</string>
</dict>
<key>PayloadDescription</key>
<string>Configures device to use Google Encrypted DNS over TLS</string>
<key>PayloadDisplayName</key>
<string>Google DNS over HTTPS</string>
<key>PayloadIdentifier</key>
<string>com.apple.dnsSettings.managed.f0ffd552-7183-4f2e-86e5-ee1ecad2a53a</string>
<key>PayloadType</key>
<string>com.apple.dnsSettings.managed</string>
<key>PayloadUUID</key>
<string>556aa9a6-04bb-4144-9a1b-e1b20cda3b46</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>ProhibitDisablement</key>
<false/>
</dict>
</array>
<key>PayloadDescription</key>
<string>Adds the Google DNS to Big Sur and iOS 14 based systems</string>
<key>PayloadDisplayName</key>
<string>Google Encrypted DNS over HTTPS</string>
<key>PayloadIdentifier</key>
<string>com.paulmillr.apple-dns</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>B27E8E10-697D-4938-8745-7FFEEEED57A0</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>