If you are connecting via network, check the driver port settings. Windows 10 always wants to use a WSD port. However these are notorious for not refreshing and showing the printer back online. You are better to use a Standard TCP/IP port for network attached printers. If you are not connecting via network then your best first step is to download the HP scan and print doctor.
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.