Apart from xdg-utils, using the alternatives mechanism will help you. On Debian (and most distros nowadays I think) it's already there, no need to install anything. I'll give you some examples regarding urls, web:
update-alternatives --list x-www-browser update-alternatives --query x-www-browser sudo update-alternatives --config x-www-browser
The last command (notice sudo, it makes changes, the 1st and 2nd are view only) will present you a menu to choose the default browser.
Have a look also (--query, --list) on gnome-www-browser. Probably www-browser too, if you use cli/tui browsers like lynx or w3m.
A bit more advanced, if you need to add an app or change priorities:
sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/LatestFirefox/firefox 300
Higher number, higher priority. You can then run,
sudo update-alternatives --config x-www-browser
And you'll see the new app among the choices.
There is a a GUI package, galternatives for easier viewing of all the available alternatives. But I don't trust it for making changes, it doesn't always works for me.