The USB connection dropped
Unplug the cable at both ends and put it back into a different port on the computer, straight in rather than through a hub. Power the printer off and on afterwards. If it still reads as offline, you likely have two copies of the printer installed from an earlier setup attempt. Delete the ones you aren't using and set the survivor as default. Worth knowing: some HP models sold as HP+ won't work over USB at all, since that programme requires the printer to stay connected to the internet.