Makes and models?
If the wifi router is already working with respect to your network requirements then most likely you will simply need to do a factory reset on the printer per the applicable printer User Guide/Manual.
Then reconfigure the printer for wireless use as if the printer was brand new. AKA "Do over".