If you are accessing it from the same network, you need to be connected in the private network. Else, the server should have a static IP.
Command to access the server is
ssh user@server-IP -p 22
ssh user@server-IP -p 22 Here user should be replaced with actual username & server-IP with actual server IP. If you have SSH configured on some other port, replace 22 with the actual SSH port.