The network is ruled by Security groups and ACLs. The instance should be in a public network, otherwise you can't reach it.
The best way to connect to an instance is from AWS Console, in the instance.
Go to the instance, then Connect, then in the Session Manager click connect, it will open a terminal in your browser.