If your HP printer in error state then he is the simple steps to fix it out
1. Make ports settings changes. Press the Windows +R key through your keyboard then type devmgmt.msc in the given field and press enter key. Enter to open the Device Manager.
2. Check your printer is Online or not.
3. Reinstall the printer driver.
4. Set the Print Spooler service to automatic.
5. Update Windows.