Technically, you can't. A modem is purely a device for converting the analogue electrical signals from your ISP to digital signals used on your internal network. A true modem does not have any login potential.
You are actually asking about logging on to your router. Not all routers support administration directly from the Internet. If it does then you have to enable WAN side administration and set up good password to enable access to the router's configuration pages. Doing this severely compromises the security of your home network and the devices on it.
If the router does not support WAN side administration, the other option is to have a remote desktop session on to a computer on your network and configure port forwarding in the router so you can get to that computer from the Internet. Then you a run a browser remotely on that computer to access the router. This option can potentially be more of a security risk than the first method above as there is a path onto one of the computers on your internal network from the Internet.
Why would you want to control your router from a remote PC?
I will assume you are referring to a cable or DSL modem. To change passwords or perform user administration tasks remotely on these devices, the device must be configured to allow access to its administration interface from the WAN port, its firewall (if any) must be configured to allow connections to the port corresponding to the access method configured on the device (SSH, Telnet, HTTP, or HTTPS typically), and you must know the correct username and password combination to log on to the device. Another method is to use software like Team Viewer on a PC at your home which you can then access remotely and use to logon to the modem and make the necessary changes.
It's probably better to ask the electronics shop 🏪 where you bought the modem from or a computer 💻 shop 🏪 to recieve a valuable answer
login to the admin page