A short checklist for when your computer says the printer is offline even though it is switched on.
Offline usually means the computer lost contact with the printer, not that the printer is broken. Work through these checks in order.
Make sure the printer is on, shows no error, and is on the same network as your computer.
Turn both off for 30 seconds and turn them back on. Wait for the Wi-Fi light to settle.
Open the print queue on your computer and cancel any stuck jobs.
In your printer settings, make sure Use Printer Offline is not ticked.
Remove the printer from your computer and add it again, using its IP address if needed.