This Kitronik micro:bit audio cable enables students to work with headphones in the classroom. If you need to demonstrate a project, these can also plug into an amplified speaker.
With a 3.5mm socket on one end, and crocodile clips on the other, just connect the cable to pins 0 and GND.
You can find micro:bit MicroPython examples for music here.
There's also MakeCode music examples here.