Use the printer's built-in cleaning tool to clean the printhead.
In the printer software, check and adjust the color settings.
Restart the printer and then the computer before attempting to print again.
If none of the preceding steps work, reinstall the printer software.
https://www.hphelp.info/blog/hp-printer-wont-print-black/