Hi,
HP's support page for this printer shows drivers for older Mac operating systems only.
The model in question does not appear to be listed in About AirPrint - Apple Support (US edition October 26, 2022).
Everything here will be experimental. You could perhaps check whether the HP 5.1.1 Printer Software Update package download from Apple would work (despite the System Requirements limitation). It may or may not open/install/work. Look for something like the HP Photosmart C309a series version 4.2.2 driver listed in the referenced article Printer and scanner drivers for Mac - Apple Support.
As always, make sure that you have backup copies of all important files before testing anything. Software conflicts cannot be ruled out.
It may be a good idea to reset the printing system before a test. See the following article for details.
Reset the printing system on your Mac to solve a problem – Apple Support (UK)
Add a printer to your printer list so you can use it on Mac – Apple Support (UK)