How to solve the issue of printing with a hp Officejet on a Mac

I have an old hp Officejet 2620 printer that works very fine. I recently got this issue when trying to print. I always get this error message “waiting for printer to become available” and no way to solve it, even after resetting the whole printer setting. I finally found the full solution. Reset the Mac