I can try. Presumably your router itself is still working fine and connected to the internet?
You need to connect the iMac to the router? Do you know what the old IP address of the router was? (192.168.0.1? 10.0.0.1? etc.) It may be shown on the base of the router itself.