Specifically you'll need to set:
- network.trr.bootstrapAddress: To a secure DNS provider you trust (to get the HTTPS DNS resolver's IP/bootstrap DNS over HTTPS). e.g. 1.1.1.1
- network.trr.mode: To 2 (DNS-over-HTTPS is first choice, fallback to OS), 3 (DNS-over-HTTPS only otherwise fail, recommended)
- network.trr.uri to the URL of your DNS-over-HTTPS provider. e.g. https://cloudflare-dns.com/dns-query
If you set all three (and mode to 3), it is a completely bespoke, highly secure DNS solution. That's what I use at work for any personal browsing.