Step 1: Make sure the printer is ready
If the printer is off or unavailable for communication, it is offline. Make sure the printer is ready to receive a print job.
Look at the printer. If it is off or in sleep mode, press the Power button to turn it on or wake it.
Make sure the printer has paper loaded into the input tray, the correct ink or toner cartridges installed, and there are no errors or blinking lights on the printer control panel.
Restart the printer and wait until it is ready to print.
Send a print job.
If the issue persists, continue to the next step.
Step 2: Use the HP Smart app
On a Mac running macOS 10.13 or later, use the Diagnose & Fix feature in the HP Smart app to help fix connection issues. For computers running macOS 10.12 or earlier, skip to the next step.
Open the HP Smart app.
If you do not have the app, download it from HP Smart – Mac App Store (in English), and then follow the prompts to add your printer.
Click Printers, and then select Diagnose & Fix.
Opening the Diagnose & Fix option
On the Diagnose & Fix screen, click Start.
Wait until the analysis completes. Do not close the HP Smart app to avoid interrupting the process.
On the diagnosis screen, review the results, and then click Test Print or Done.
I hope both these solutions will be useful to fix HP printer not responding to Mac issue.