Users with this complaint sometimes made "unrelated" changes that clobber their connection to the Printer.
Network problems:
• Changes to network configuration, especially replacing the Router with a new one (that move the network IP Addresses to a different range of local addresses).
• Having the Printer use a DHCP IP Address rather than the vastly-preferable Manually-assigned IP Address. When the Printer gets a new IP Address (which can happen form time-to-time) it cannot be reached because it is configured (on the Mac) for a fixed Address that it is no longer using.
Mac OS X problems:
• upgrading to new version of Mac OS X (especially to El Capitan) without re-creating the Printer so that it uses its latest Driver.
• configuring the Printer as the wrong type of Printer (default Bonjour ) rather than IP Printer using {HP Jetdirect Socket, Line Printer Daemon (LPD), Internet Printing Protoco (lPP) }
• general Mac OS X problems such as damaged install of Mac OS X
• Utilities or so-called "anti-Virus" that conflicts with proper operation of the Printer on your Mac.
Dumb (really dumb) printers:
• some printers are so dumb, they cannot even be discovered in the usual way, and require a manufacturer's configurator program to discover and "pre-Install" the Printer queue on your Mac.
Can you tell us more details of this non-printing problem?
EDIT: with your response, I guess I can add "Printer connected to neighboring unprotected Network" to the network problems list.