This behaviour can be caused if the printer is starved for power because it is connected to either a surge bar, a multi-outlet tap or a UPS. Printers should be plugged directly into the wall. The next thing to test is printing any report from the printer control panel. If you can do that then you know that power and basic printer functions are working. If the printer fails to print a report then you have a hardware issue with the printer. If it does print then the likely issue is either out of date firmware or a corrupted/incorrect driver. Go to support.hp.com and check for the current firmware for your printer, if not correct download and install the current firmware. In terms of driver, uninstall and reinstall, using current drivers from the website.
If you find the information provided useful or solves your problems, help other users find the solution easier by giving kudos and marking my post as an accepted solution. I am a volunteer, offering my knowledge to support fellow users, I do not work for HP nor speak for HP.
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".