In Ubuntu, there are two methods available to set or change the default applications. You can set this via system settings or the via right click options menu on the file. Now we are going to see these two options one by one.
Set Default Applications In Ubuntu via right click options: [Ubuntu 23.04 & Later]
If you want to open any file in a non default application, just right-click on the file and select Open with menu option.
The current default app will show under Default App section. If you want to change or set a new one as default, select your favorite application from the below Recommended apps section and toggle or enable the Always use for this file type and click Open.
After that, all same kind of the files types will be opened with your chosen default app.
Set Default Applications In Ubuntu via System Settings:
Click the Show Apps Button from the Ubuntu dock and type Settings in the search field. And click the Settings app.
Now click the Default Apps option from the left sidebar menu.
Here you can only set default applications for the browser, mail client, calendar, music, videos and photo.