A Microsoft account renewal should not normally cause your HP LaserJet 1020 printer to go offline.
Go to Settings > Bluetooth & devices > Printers & scanners.
Select HP LaserJet 1020 and click Remove.
Disconnect the printer's USB cable and restart your computer.
Reconnect the printer and turn it on.
Go back to Printers & scanners, click Add device, and follow the instructions to add the printer again.