The following instructions are for setting up DNS over HTTPS with Firefox on the desktop. If you're using Firefox on mobile the screens will look a little different, but you should still be able to follow the steps.
Go to the menu and click Options
Then scroll to the bottom and in the Network Settings section, click Settings.
Scroll to the bottom again, and click the checkbox to Enable DNS over HTTPS.
Where it says Use Provider, change that to Custom, and then in the Custom field, put in your custom URL: