How to install .deb file in Ubuntu
Introduction
Ubuntu and other Debian derivatives (for example, Linux Mint) use installable software packages with .deb file extension. Usually, you download deb package from the vendor and then install the software from that file without having to compile it. This is different from the case when you download the source code and compile that source code for in order to have the software installed.
It’s possible to install deb software package either via CLI or via Ubuntu Software Manager and we will have a look at both options.
Requirements
I will be installing Visual Studio Code editor from a .deb package downloaded from https://code.visualstudio.com/download so feel free to download this or any other .deb file from a reputable source.

When installing software directly from a package instead of using official repositories it’s always good to ensure that the source of the package is legit and you can trust it.
Install deb software package from CLI
Ubuntu comes with a utility called apt that allows to install software from both managed repositories and directly from .deb package files.
To install the software you will need to run “sudo apt install” followed by the path to the .deb file. Since I have the file in Downloads directory the command in my case will be the following:
sudo apt install ~/Downloads/code_1.72.2-1665614327_amd64.deb
Once installation is complete you will be able to go ahead and start using the software.
Install deb software package via Ubuntu Software manager (GUI)
Navigate to the directory where you downloaded the file and right-click on the .deb file, then click on “Open With Software Install” as shown below:

If you don’t see “Open With Software Install” option then click on Properties and change the Default Application for the file:

Another option is to click on “Open With Other Application” after right-clicking on the file.
After you open the .deb file via Ubuntu Software manager you will see the similar window where you only need to click on “Install” button:

You will be prompted for your password because installation requires escalated privileges, so enter your password and click Authenticate:

Then wait for the installation process to complete and you will be able to use the new software.
Conclusion
Thank you for reading, hope this was helpful. More info on apt utility can be found here: https://manpages.ubuntu.com/manpages/trusty/man8/apt.8.html