Chances are that the flashing lights are an indicator that a printer component is malfunctioning. HP has a diagnostic tool called the “Print and Scan Doctor” that can help you find the broken part. You can download the tool from HP at the link below:
[https://support.hp.com/us-en/help/diagnostics?category=printing&issue=printer-setup|https://support.hp.com/us-en/help/diagnostics?category=printing&issue=printer-setup]
Click on the blue Download button to obtain the tool. Make sure that the printer is connected to your PC, and run the tool so that it can help troubleshoot the problem.