Thank you for the information. According to the specifications (https://support.hp.com/us-en/product/hp-laserjet-pro-200-color-printer-m251-series/5097632/model/5097639/document/c03315004), the HP LaserJet Pro 200 color Printer M251nw supports AirPrint (a model with the somewhat different name HP LaserJet Pro color M251nw is also listed in About AirPrint - Apple Support). An AirPrint-enabled printer can be used without having to install additional drivers, provided that the computer and the printer are connected to the same Wi-Fi network (router).
If the printer is properly connected to the Wi-Fi network (Connect an AirPrint printer to a Wi-Fi network – Apple Support (UK)), but not recognised by the computer, you may want to try resetting the printing system and re-adding the printer as an AirPrint printer.
Reset the Mac printing system to solve a problem – Apple Support (UK)
Add a printer on Mac – Apple Support (UK)
If necessary, try the following procedure:
Power off the Wi-Fi router, the printer, the iMac, and all other devices/computers. Wait two to three minutes. Power on the router. Wait two to three minutes. Power on the printer. Wait a minute or two. Power on the iMac. Finally, power on all other devices/computers.