By default a new AWS EC2 instance only exposes port 22 to the Web to enable accessing the new EC2 instance via ssh. Often it's helpful to open other ports to the Web so that you can access them via a browser. This tutorial shows 2 different ways of exposing ports on AWS EC2 instances.
Additionally if you're not interested in exposing a port to the Web but would still like to access it via your browser you can use port forwarding in VS Code which is covered in the final section below.
When launching a new EC2 instance, fill out the following items