The modem situation in the fiber era is dire. Back when we all relied on phone lines you could've just hooked up your own modem, punch in PPPoE credentials and that was that, but now with fiber there is no standardization like that and the way it works is that the ISP gives you their hardware, and you have to use their hardware as there's no other way to hook up to their infrastructure.
Technically.
You need something called an ONT, or Optical Network Terminal, meant to take an optical fiber signal and translate it to a copper one to send through an Ethernet cable to the router. Thing is, it's now common for ISP's to integrate it into their router, and if you don't live in a totalitarian shithole where corpos can dictate what you can and cannot do without any repercussions, so anywhere but the United States of America, you're SOL when it comes to replacing it with your own hardware.
If you live in a totalitarian shithole that actually tries to reign corpos in, like the European Union, then you have more options. It's very likely you can harass your ISP to toggle their hardware into "bridge mode", meaning that all the routing capabilities of their shitware is disabled and it acts as a plain ONT where you can then hook up your own hardware to that. If you're lucky, you'll get a dedicated ONT, for example the fiber infrastructure that is hooked up to your household doesn't belong to the ISP so between their hardware and the network you get an ONT of the infrastructure owner, simplifying the process of swapping your ISP's hardware for your own.
There is also a third option that's way less popular but also way less available. Buying your own ONT and reprogramming it so that it clones that of your ISP. There is a whole bunch of caveats with this one.
First, availability of such devices. I only know of Leox/LeoLabs, a fairly niche Polish ISP that is also a manufacturer of it's own ONT's that are designed to be capable of cloning any ONT terminal there is. The global availability of those is limited.
Second, the nature of ONT's. Due to all those incompatibilities with ONT standards ISP's tend to force you to use their ONT's due to the fact that a misconfigured ONT would be capable of shutting their entire infrastructure down and you'd be liable for it. Of course, if you do everything correctly that won't happen, but it is possible that the ISP will shut down their services to you as they'll detect an ONT that's not theirs and won't take that risk. This is ISP dependent, some will see that but won't care since your shit will just work.
Third, the evermore increasing Internet speeds. Home fiber is now starting to hit 8Gbps where you will need an ONT with a 10Gbps port to be able to support such a connection. Meaning that depending on your Internet speeds your choice of hardware can change drastically. For example, if you want an SFP+ based ONT to make your network connections simpler, Leox only offers one that closes off at 2.5Gbps, and for 10Gbps you need the classic ONT box model.
There are also issues regarding how legislations that are meant to let you choose your own hardware are implemented. The EU drafted a fantastic pro-consumer legislation, but when it hit Polish lawmakers, they've purposefully mistranslated it so that the ISP's have more control over the consumer, contrary to what the EU meant, causing a years long fight of consumers with the system where the amount of home consumers that want to set up their own hardware is too small to make UOKiK, the Polish government's consumer rights protection office, to bother and make it easier for end consumers to use their own hardware. Another funny tidbit is how Orange SA of France will give their home users routers with SFP+ ports and dedicated SFP+ modules for 8Gbps connections making it trivial to use their own hardware, but Orange S.A. of Poland doesn't do such a thing and you have to actively fight them to get an ONT of any sort before they install fiber connectivity to your house.
Again, it all depends on the country you're in, but if you're in the US, chances are you're SOL since American ISP's are the most anti-consumer ISP's in the world since the US is a corpocracy through and through.