The printer is connected my wi-fi network with a good connection. This happens every time I don't use my iMac for a while. When I come back the next day, and printer something, it's stuck in the print queue which says it's trying to connect to the printer. When I install the printer under Printers & Scanners system preferences, I can print to the printer at first.
Since upgrading to High Sierra, my iMac has recurring problems with losing the connection to my wi-fi printer.