Imagine you’re on a private network or the remote network doesn’t allow connections on a specific server on a specific port. To get around this we can create a tunnel from local connection to remote server which isn’t on our network.

ssh user@remoteserver -L localport:locahost:remoteport

The key here is -L which says we’re doing local port forwarding. Then it says we’re forwarding our local port to remoteport. Now open your browser and go to http://localhost:localport.