Hii,
First, disconnect the USB cable. Then, go to Start > Settings > Bluetooth & devices > Printers > select HP Smart Tank 580 and click Remove Devices. You need to remove all devices, including USB and Network.
Remove all HP applications.
https://support.hp.com/pt-pt/drivers/hp-smart-tank-5100-all-in-one-printer-series/2100992728
Download the HP printer driver using autorun, run it as administrator, and follow the instructions. It will ask if you want to connect via network or USB. Select USB.
Run the automatic driver installation procedure to add the printer again using offline software.
Although this is not a Microsoft website, it is the official website for [Smart 5100/HP].
If the answer was helpful, please click "Accept Answer" and upvote. If you have any further questions regarding this answer, please click "Leave a comment".
Note: If you would like to receive notifications about this discussion, please enable email notifications by following the instructions in our documentation.
Thanks