The ML-2165W does not appear to be a model supporting Apple's driverless AirPrint technology, and (as you also mentioned) the drivers from HP's support site for this printer are for older Mac operating systems.
Since it is an ML-2165W, you should be able to connect it wirelessly to a Wi-Fi router, but appropriate drivers will be needed.
http://h10032.www1.hp.com/ctg/Manual/c05786357.pdf#G3.4665771
You could perhaps carry out an experiment with a driver for another printer model. This may or may not work with your printer. It may be a good idea to begin by resetting the printing system (see link above).
Initially based upon old (macOS Catalina) ML-2161 compatibility information in the article https://support.hp.com/us-en/document/c06520117, it may be worth testing whether the latest (May 9, 2022) V3.93.03 Samsung universal print driver for macOS 12 possibly could be used in this case. The idea would be to re-add your printer while choosing to use something like the ML-2160, M2020, or M2070 printer software from the package.
https://ftp.hp.com/pub/softlib/software13/printers/SS/Print_Common_SW/Samsung_Mac_Driver_V3.93.03.dmg
Before testing any printer drivers, make sure that you have multiple backup copies of all important files (documents, photos, et cetera). Software conflicts can never be ruled out.
See also the Samsung leserjet 3400 printer not printing - Apple Community discussion with a picture (with a list of drivers) provided by divesh81.
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)