Follow the below step one by one without missing any items to fix your printer from offline to online.
Printer and Cable Checks
-Check if the cable are firmly inserted from both the ends
-Check the Ethernet cable if the printer is on a network is .
-Check your internet connection If the printer is wireless or make sure it’s connected to your router.
-Check the printer cable in multiple ports or sockets if you’re connected by cable, try using the end of on your device.
-Try changing the cable to make sure the fault is not with the cable alone.
-If you’re on a network or wireless device a simple check would be to attach a cable to your computer/or device to make sure your printer is working. Therefore the fault could be with your network connection.