If you changed your modem / router, the printer has no way of knowing this because it was programmed to connect to your "old" modem.
You need to reset the printer back to its factory default settings, so it can be set up again to connect to your "new" modem. For this, you will need to contact the Customer Support folks at the printer manufacturer.
Now.......if for some reason you want to buy a new printer, that device will still need to be set up to your "new" modem as well. So, no matter whether you want to reset your current printer or buy a new printer, you are still going to be faced with having to the set the device up.
If your current printer was working fine with the "old" modem, I see no reason why it will not work just fine with the "new" modem providing that the printer is configured correctly.
But, it's your call.