I assume you’re talking USB connection, not the computer and printer on the ethernet.
So if USB - it’s a process of elimination.
Driver, USB port, cable, printer USB port, printer function…
It printed a while ago, likely the driver on your PC is fine. I assume you’ve done the “turn everything off and on again” routine, still no workee. Usually wait until the PC is back up and running, then turn on the printer. Or unplug the USB and plug it back in… You can always delete the printer and ask your PC to find it, but obviously if it can’t see the printer now, it’s not going to add it.
Did you try a different USB port? Does your mouse, for example, work in the USB port the printer was in? USB ports stopping working - either permanently or time to time - is not unheard of.
As others say, the cable. try a different cable. Check to see it hasn’t been strained, or run over by the chair, etc.
It’s even more convenient if you have another PC to test the printer with, to see if it’s the USB port on the printer. But the fact that another (formerly working?) printer has the same issue suggests “not the printer”. I assume you can print the printer status page using the buttons on the printer, so the printer mechanism is fine.
My guess from experience is the PC’s USB port has stopped working. Try a different port.
If the printer has an ethernet interface, the test is easy - is the printer seeing the network and getting a network address? Usually printer status page will tell you this. 10.0.0.51 or some such 4-number IP address. Link light on the ethernet port, etc.
(The ethernet port on my Brother 2270 died last year and fortunately, the USB port still works.)