Hi,
Which exact HP printer model is it?
For general information, see:
Add a printer to your printer list so you can use it on Mac – Apple Support (UK)
Reset the printing system on your Mac to solve a problem – Apple Support (UK)
If the printer is a model supporting Apple's AirPrint technology, check that the printer and the MacBook Pro are connected to the same network (Wi-Fi router). Double-check all Wi-Fi settings (bands, security, et cetera).
You may also want to try a full power-cycle procedure (do not forget the router):
Power off the Wi-Fi router, the HP printer, the MacBook Pro, and all other computers/devices. Wait two to three minutes. Power on the router. Wait two to three minutes. Power on the HP printer. Wait a minute or two. Power on the MacBook Pro. Finally, power on all other computers/devices.