For HP Printer Keeps Going Offline, you require to connect the printer to the wireless network.

Disconnect your wireless printer.

After that, you must detach the power wire from its back.

Switch Off the system where you were attempting to print documents.

The printer's backside is where the power cord should be connected. Now switch it on.

After waiting for 20 seconds, cut the wireless router's power cord.

Then, reattach the router's power cord.

Turn the system ON at the end.