A modem is eletronic device that converts analog signal to digital and vice versa. The name accurately reflects this feature, as it comes from the combination of the English words MODulator (modulator) and DEModulator (demodulator).
In order for you to understand what this means, you need to take a look at the past.
In the early days of the Internet as we know it, the internet access were made basically using the fixed telephony networks. The problem is that these networks were developed for the transmission of information (voice) through analog signal, not for digital signal traffic (data).
This is where the modem comes in. It is this device that converts the digital signal to analog (a process known as modulation), as well as to convert analog signal to digital (demodulation).
In short, the demodulation process works like this: the Internet provider transmits the signal through the telephone network, the modem receives it and then converts it to digital for transmission to the computer that is connected to it.
In the modulation process, the data from the computer is converted into an analog signal so that it can be demodulated at the other end of the connection.
This type of modem was predominant for some years, when the so-called dial-up connections were the most common. At that time (the 1990s and early 2000s, basically), modems worked with bandwidths of only 56 Kb/s.
As time went by, the dial-up connections were replaced by much faster technologies, such as ADSL, 3G and 4G mobile networks, optical fiber, among others.
Because of this, it is common to find devices like ADSL modem, 4G modem, fiber optic modem and so on. Today, any device that makes the communication between a computer or a private network (like the Wi-Fi of your home) and the internet is accepted as modem by definition.
What is known as a fiber optic modem, for example, is actually a device called ONT (Optical Network Terminal). This device converts the optical signal into an electrical one to allow communication, but it does not work like the original modems.