The LEGO Education Website EV3 firmware update page lists two options.
Use the EV3 Device Manager web page. The instructions are not entirely clear, but if you visit the web page with Chrome (recommended), Safari, Edge, or Internet Explorer, click the Available Bricks (0) button and wait a very long time, it will eventually pop up a dialog asking to ...
Update: we made it work, after trying many things, see below.
Opened the brick and inspected it for obvious signs of problems but saw nothing. Even tried with the screen disconnected.
We tried, as suggested in the comment above, with a firmware update. Even though the brick will stay on for only a few seconds, it was enough for the computer to recognize it ...
You can get community support for Pybricks at https://github.com/pybricks/support.
ir.buttons(1) returns a list of pressed buttons, so in this particular program
if ir.buttons(1) == Button.BEACON:
needs to be changed to
if Button.BEACON in ir.buttons(1):
This will test if item is in list.